Skip to content

Commit

Permalink
fix warning: (SA1006) go-staticcheck
Browse files Browse the repository at this point in the history
printf-style function with dynamic format string and no further arguments should use print-style function instead
  • Loading branch information
pilinux committed Aug 25, 2024
1 parent b158a5d commit 20a21f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.59.1
version: v1.60.3

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"crypto"
"crypto/sha256"
"errors"
"fmt"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -383,7 +382,7 @@ func security() (securityConfig SecurityConfig, err error) {

cipherKey := strings.TrimSpace(os.Getenv("CIPHER_KEY"))
if cipherKey == "" {
err = fmt.Errorf("CIPHER_KEY is missing")
err = errors.New("CIPHER_KEY is missing")
return
}
cipherKeyHash2 := sha256.Sum256([]byte(cipherKey)) // sha2-256
Expand Down
3 changes: 2 additions & 1 deletion lib/middleware/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package middleware
import (
"crypto/ecdsa"
"crypto/rsa"
"errors"
"fmt"
"net/http"
"strings"
Expand Down Expand Up @@ -277,7 +278,7 @@ func GetJWT(customClaims MyCustomClaims, tokenType string) (string, string, erro
ttl = JWTParams.RefreshKeyTTL
nbf = JWTParams.RefNbf
default:
return "", "", fmt.Errorf("invalid token type")
return "", "", errors.New("invalid token type")
}

// Create the Claims
Expand Down

0 comments on commit 20a21f2

Please sign in to comment.