Browse Source

fix lint configuration and a warning

Nicola Murino 4 years ago
parent
commit
d4bfc3f6b5
2 changed files with 6 additions and 4 deletions
  1. 5 3
      .golangci.yml
  2. 1 1
      httpd/httpd_test.go

+ 5 - 3
.golangci.yml

@@ -19,8 +19,11 @@ linters-settings:
     simplify: true
   goimports:
     local-prefixes: github.com/drakkan/sftpgo
-  maligned:
-    suggest-new: true
+  #govet:
+    # report about shadowed variables
+    #check-shadowing: true
+    #enable:
+    #  - fieldalignment
 
 linters:
   enable:
@@ -34,7 +37,6 @@ linters:
     - bodyclose
     - gocyclo
     - misspell
-    - maligned
     - whitespace
     - dupl
     - rowserrcheck

+ 1 - 1
httpd/httpd_test.go

@@ -4828,7 +4828,7 @@ func TestWebClientChangePubKeys(t *testing.T) {
 	checkResponseCode(t, http.StatusOK, rr)
 	assert.Contains(t, rr.Body.String(), "Your public keys has been successfully updated")
 
-	user, _, err = httpdtest.GetUserByUsername(defaultUsername, http.StatusOK)
+	user, _, err = httpdtest.GetUserByUsername(user.Username, http.StatusOK)
 	assert.NoError(t, err)
 	assert.Len(t, user.PublicKeys, 1)