From 87053c93120761639837745a498f7d13b78f7d92 Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Tue, 5 May 2020 14:43:46 +1000 Subject: [PATCH] [CI] Add linters: asciicheck, nolintlint and unconvert (#978) --- .golangci.yml | 3 +++ go.mod | 1 - internal/handlers/handler_verify.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b3aa45cc..19bbd49f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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 diff --git a/go.mod b/go.mod index 17df4098..a090ab7b 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/internal/handlers/handler_verify.go b/internal/handlers/handler_verify.go index 7fd5c4dc..a3e64f1b 100644 --- a/internal/handlers/handler_verify.go +++ b/internal/handlers/handler_verify.go @@ -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 == ""