Skip to content

Commit

Permalink
Update staticcheck
Browse files Browse the repository at this point in the history
switch to errors.New() for error messages without formatting to avoid this lint error:

> printf-style function with dynamic format string and no further arguments should use print-style function instead (SA1006)
  • Loading branch information
Cornelicorn committed Aug 15, 2024
1 parent 6df5723 commit 8782c8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ clean:
.PHONY: lint
lint:
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@v0.4.7 ./...
go run honnef.co/go/tools/cmd/staticcheck@v0.5.1 ./...

.PHONY: test
test:
Expand Down
6 changes: 3 additions & 3 deletions cmd/sbctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ func main() {
} else if errors.Is(err, sbctl.ErrImmutable) {
logging.Println("You need to chattr -i files in efivarfs")
} else if errors.Is(err, sbctl.ErrOprom) {
logging.Error(fmt.Errorf(opromErrorMsg))
logging.Error(errors.New(opromErrorMsg))
} else if errors.Is(err, sbctl.ErrNoEventlog) {
logging.Error(fmt.Errorf(noEventlogErrorMsg))
logging.Error(errors.New(noEventlogErrorMsg))
} else if errors.Is(err, ErrSetupModeDisabled) {
logging.Error(fmt.Errorf(setupModeDisabled))
logging.Error(errors.New(setupModeDisabled))
} else if !errors.Is(err, ErrSilent) {
logging.Error(err)
}
Expand Down

0 comments on commit 8782c8a

Please sign in to comment.