Skip to content

Commit efd6a76

Browse files
authored
Merge pull request #1128 from huiyifyj/fix-typo
Fix typo and go fmt this file
2 parents 2916a1f + 1fb9b90 commit efd6a76

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

csr/csr.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ type CAConfig struct {
132132
// A CertificateRequest encapsulates the API interface to the
133133
// certificate request functionality.
134134
type CertificateRequest struct {
135-
CN string `json:"CN" yaml:"CN"`
136-
Names []Name `json:"names" yaml:"names"`
137-
Hosts []string `json:"hosts" yaml:"hosts"`
138-
KeyRequest *KeyRequest `json:"key,omitempty" yaml:"key,omitempty"`
139-
CA *CAConfig `json:"ca,omitempty" yaml:"ca,omitempty"`
140-
SerialNumber string `json:"serialnumber,omitempty" yaml:"serialnumber,omitempty"`
135+
CN string `json:"CN" yaml:"CN"`
136+
Names []Name `json:"names" yaml:"names"`
137+
Hosts []string `json:"hosts" yaml:"hosts"`
138+
KeyRequest *KeyRequest `json:"key,omitempty" yaml:"key,omitempty"`
139+
CA *CAConfig `json:"ca,omitempty" yaml:"ca,omitempty"`
140+
SerialNumber string `json:"serialnumber,omitempty" yaml:"serialnumber,omitempty"`
141141
Extensions []pkix.Extension `json:"extensions,omitempty" yaml:"extensions,omitempty"`
142142
}
143143

@@ -270,9 +270,9 @@ func getHosts(cert *x509.Certificate) []string {
270270
}
271271

272272
// getNames returns an array of Names from the certificate
273-
// It onnly cares about Country, Organization, OrganizationalUnit, Locality, Province
273+
// It only cares about Country, Organization, OrganizationalUnit, Locality, Province
274274
func getNames(sub pkix.Name) []Name {
275-
// anonymous func for finding the max of a list of interger
275+
// anonymous func for finding the max of a list of integer
276276
max := func(v1 int, vn ...int) (max int) {
277277
max = v1
278278
for i := 0; i < len(vn); i++ {
@@ -430,12 +430,12 @@ func appendCAInfoToCSR(reqConf *CAConfig, csr *x509.CertificateRequest) error {
430430
}
431431

432432
csr.ExtraExtensions = append(csr.ExtraExtensions, pkix.Extension{
433-
Id: asn1.ObjectIdentifier{2, 5, 29, 19},
434-
Value: val,
435-
Critical: true,
436-
})
433+
Id: asn1.ObjectIdentifier{2, 5, 29, 19},
434+
Value: val,
435+
Critical: true,
436+
})
437437

438-
return nil
438+
return nil
439439
}
440440

441441
// appendCAInfoToCSR appends user-defined extension to a CSR

0 commit comments

Comments
 (0)