Skip to content

Commit

Permalink
Fix linter errors and split lint goal
Browse files Browse the repository at this point in the history
  • Loading branch information
maraino committed Oct 6, 2023
1 parent 11e14b3 commit d04d926
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ race:
fmt:
$Q goimports -l -w $(SRC)

lint: SHELL:=/bin/bash
lint:
lint: golint govulncheck

golint: SHELL:=/bin/bash
golint:
$Q LOG_LEVEL=error golangci-lint run --config <(curl -s https://raw.githubusercontent.com/smallstep/workflows/master/.golangci.yml) --timeout=30m

govulncheck:
$Q govulncheck ./...

.PHONY: fmt lint
.PHONY: fmt lint golint govulncheck

#########################################
# Go generate
Expand Down
6 changes: 3 additions & 3 deletions x509util/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func (s SubjectAlternativeName) RawValue() (asn1.RawValue, error) {
switch {
case len(s.ASN1Value) != 0:
data = s.ASN1Value
case len(s.Value) != 0:
case s.Value != "":
data = []byte(s.Value)
default:
return zero, errors.New("error parsing HardwareModuleName SAN: empty asn1Value is not allowed")
Expand All @@ -390,7 +390,7 @@ func (s SubjectAlternativeName) RawValue() (asn1.RawValue, error) {
switch {
case len(s.ASN1Value) != 0:
data = s.ASN1Value
case len(s.Value) != 0:
case s.Value != "":
data = []byte(s.Value)
default:
return zero, errors.New("error parsing DirectoryName SAN: empty asn1Value is not allowed")
Expand All @@ -413,7 +413,7 @@ func (s SubjectAlternativeName) RawValue() (asn1.RawValue, error) {
Bytes: rdn,
}, nil
case UPNType:
if len(s.Value) == 0 {
if s.Value == "" {
return zero, errors.New("error parsing UserPrincipalName SAN: empty Value is not allowed")
}
rawBytes, err := marshalExplicitValue(s.Value, "utf8")
Expand Down

0 comments on commit d04d926

Please sign in to comment.