diff --git a/internal/authentication/authentication.go b/internal/authentication/authentication.go index 2592b29..886ecc0 100644 --- a/internal/authentication/authentication.go +++ b/internal/authentication/authentication.go @@ -61,7 +61,7 @@ func (a *Authenticator) requireUserProperty(has hasUserProperty) gin.HandlerFunc // RequireUser returns a Gin middleware which requires valid user credentials to be supplied with the request. func (a *Authenticator) RequireUser() gin.HandlerFunc { - return a.requireUserProperty(func(user *model.User) bool { + return a.requireUserProperty(func(_ *model.User) bool { return true }) } diff --git a/internal/authentication/token.go b/internal/authentication/token.go index 7e91d6f..9b53cd1 100644 --- a/internal/authentication/token.go +++ b/internal/authentication/token.go @@ -13,9 +13,9 @@ var ( ) func randIntn(n int) int { - max := big.NewInt(int64(n)) + maxValue := big.NewInt(int64(n)) - res, err := rand.Int(rand.Reader, max) + res, err := rand.Int(rand.Reader, maxValue) if err != nil { panic("random source is not available") } diff --git a/tests/mockups/helper.go b/tests/mockups/helper.go index 8fbbb7e..e4b4edb 100644 --- a/tests/mockups/helper.go +++ b/tests/mockups/helper.go @@ -5,8 +5,8 @@ import ( "encoding/base64" ) -func randStr(len int) string { - buff := make([]byte, len) +func randStr(length int) string { + buff := make([]byte, length) _, err := rand.Read(buff) if err != nil { @@ -16,5 +16,5 @@ func randStr(len int) string { str := base64.StdEncoding.EncodeToString(buff) // Base 64 can be longer than len - return str[:len] + return str[:length] }