Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneWerner87 committed Oct 11, 2023
1 parent b50d91d commit bb90fc1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion middleware/csrf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Config struct {

// Name of the session cookie. This cookie will store session key.
// Optional. Default value "csrf_".
// Overriden if KeyLookup == "cookie:<name>"
// Overridden if KeyLookup == "cookie:<name>"
CookieName string

// Domain of the CSRF cookie.
Expand Down
6 changes: 4 additions & 2 deletions middleware/csrf/helpers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package csrf

import "crypto/subtle"
import (
"crypto/subtle"
)

func compareTokens(a, b []byte) bool {
return subtle.ConstantTimeCompare(a, b) == 1
return subtle.ConstantTimeCompare(a, b) == 1
}
4 changes: 3 additions & 1 deletion middleware/csrf/token.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package csrf

import "time"
import (
"time"
)

type Token struct {
Key string `json:"key"`
Expand Down
2 changes: 1 addition & 1 deletion utils/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func AssertEqual(tb testing.TB, expected, actual interface{}, description ...str
_, _ = fmt.Fprintf(w, "\nExpect:\t%v\t(%s)", expected, aType)
_, _ = fmt.Fprintf(w, "\nResult:\t%v\t(%s)", actual, bType)

result := ""
var result string
if err := w.Flush(); err != nil {
result = err.Error()
} else {
Expand Down

0 comments on commit bb90fc1

Please sign in to comment.