1
0
Fork 0

Update linter

This commit is contained in:
Ludovic Fernandez 2020-05-11 12:06:07 +02:00 committed by GitHub
parent f12c27aa7c
commit 328611c619
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
157 changed files with 489 additions and 508 deletions

View file

@ -10,7 +10,7 @@ import (
const cookieNameLength = 6
// GetName of a cookie
// GetName of a cookie.
func GetName(cookieName string, backendName string) string {
if len(cookieName) != 0 {
return sanitizeName(cookieName)
@ -19,7 +19,7 @@ func GetName(cookieName string, backendName string) string {
return GenerateName(backendName)
}
// GenerateName Generate a hashed name
// GenerateName Generate a hashed name.
func GenerateName(backendName string) string {
data := []byte("_TRAEFIK_BACKEND_" + backendName)
@ -33,7 +33,7 @@ func GenerateName(backendName string) string {
return fmt.Sprintf("_%x", hash.Sum(nil))[:cookieNameLength]
}
// sanitizeName According to [RFC 2616](https://www.ietf.org/rfc/rfc2616.txt) section 2.2
// sanitizeName According to [RFC 2616](https://www.ietf.org/rfc/rfc2616.txt) section 2.2.
func sanitizeName(backend string) string {
sanitizer := func(r rune) rune {
switch r {