Skip to content

Commit

Permalink
lint: fix linter error
Browse files Browse the repository at this point in the history
fix following lint error in cmd/cotsCreate.go:
    "S1002: should omit comparison to bool constant"

Signed-off-by: Jagannathan Raman <[email protected]>
  • Loading branch information
jraman567 committed Aug 23, 2024
1 parent 775b203 commit 001495d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/cotsCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func checkctsCreateCtsArgs() error {
return errors.New("no environment template supplied")
}

if (*cotsCreateTagUUID != false && *cotsCreateTagID != "") || (*cotsCreateTagUUID != false && *cotsCreateTagUUIDStr != "") || (*cotsCreateTagUUIDStr != "" && *cotsCreateTagID != "") {
if (*cotsCreateTagUUID && *cotsCreateTagID != "") || (*cotsCreateTagUUID && *cotsCreateTagUUIDStr != "") || (*cotsCreateTagUUIDStr != "" && *cotsCreateTagID != "") {
return errors.New("only one of --uuid, --uuid-str and --id can be used at the same time")
}

Expand Down Expand Up @@ -181,7 +181,7 @@ func ctsTemplateToCBOR(language string, tagID string, genUUID bool, uuidStr stri

if tagID != "" {

Check failure on line 182 in cmd/cotsCreate.go

View workflow job for this annotation

GitHub Actions / Lint

ifElseChain: rewrite if-else to switch statement (gocritic)
cts.SetTagIdentity(tagID, version)
} else if genUUID != false {
} else if genUUID {
u := uuid.New()
b, _ := u.MarshalBinary()
cts.SetTagIdentity(b, version)
Expand Down

0 comments on commit 001495d

Please sign in to comment.