Add gocritic linter (#1324)

* Add gocritic linter

`gocritic` provides diagnostics that check for bugs, performance, and style issues

We disable the following checks:

- commentFormatting
- captLocal
- deprecatedComment

This PR contains many `//nolint:gocritic` to disable `appendAssign`.
This commit is contained in:
Yury Gargay
2023-11-27 16:40:02 +01:00
committed by GitHub
parent 63d211c698
commit d1a323fa9d
31 changed files with 110 additions and 101 deletions

View File

@@ -192,13 +192,14 @@ func writeSuccess(w http.ResponseWriter, key *server.SetupKey) {
func toResponseBody(key *server.SetupKey) *api.SetupKey {
var state string
if key.IsExpired() {
switch {
case key.IsExpired():
state = "expired"
} else if key.IsRevoked() {
case key.IsRevoked():
state = "revoked"
} else if key.IsOverUsed() {
case key.IsOverUsed():
state = "overused"
} else {
default:
state = "valid"
}