fix lint errors

pull/2675/head
René Werner 2023-10-11 15:16:35 +02:00
parent b50d91d58e
commit bb90fc1187
4 changed files with 9 additions and 5 deletions

View File

@ -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.

View File

@ -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
}

View File

@ -1,6 +1,8 @@
package csrf
import "time"
import (
"time"
)
type Token struct {
Key string `json:"key"`

View File

@ -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 {