[CI] Add linters: asciicheck, nolintlint and unconvert (#978)

pull/959/head
Amir Zarrinkafsh 2020-05-05 14:43:46 +10:00 committed by GitHub
parent 4db5807bac
commit 87053c9312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -14,6 +14,7 @@ linters-settings:
linters:
enable:
- asciicheck
- goconst
- gocyclo
- godot
@ -23,7 +24,9 @@ linters:
- interfacer
- maligned
- misspell
- nolintlint
- prealloc
- unconvert
- unparam
- whitespace

1
go.mod
View File

@ -16,7 +16,6 @@ require (
github.com/go-ldap/ldap/v3 v3.1.8
github.com/go-sql-driver/mysql v1.5.0
github.com/golang/mock v1.4.3
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/lib/pq v1.5.1
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/onsi/ginkgo v1.10.3 // indirect

View File

@ -176,7 +176,7 @@ func hasUserBeenInactiveTooLong(ctx *middlewares.AutheliaCtx) (bool, error) { //
}
// verifySessionCookie verifies if a user is identified by a cookie.
func verifySessionCookie(ctx *middlewares.AutheliaCtx, targetURL *url.URL, userSession *session.UserSession, refreshProfile bool, refreshProfileInterval time.Duration) (username string, groups []string, authLevel authentication.Level, err error) { //nolint:unparam
func verifySessionCookie(ctx *middlewares.AutheliaCtx, targetURL *url.URL, userSession *session.UserSession, refreshProfile bool, refreshProfileInterval time.Duration) (username string, groups []string, authLevel authentication.Level, err error) {
// No username in the session means the user is anonymous.
isUserAnonymous := userSession.Username == ""