1
0
Fork 0

Update to go1.22

Co-authored-by: Julien Salleyron <julien.salleyron@gmail.com>
This commit is contained in:
Ludovic Fernandez 2024-02-07 17:14:07 +01:00 committed by GitHub
parent e11ff98608
commit d5cb9b50f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 4189 additions and 3419 deletions

View file

@ -4,9 +4,9 @@ import (
"container/heap"
"context"
"errors"
"fmt"
"hash/fnv"
"net/http"
"strconv"
"sync"
"github.com/traefik/traefik/v2/pkg/config/dynamic"
@ -156,7 +156,7 @@ func (b *Balancer) nextServer() (*namedHandler, error) {
defer b.handlersMu.Unlock()
if len(b.handlers) == 0 {
return nil, fmt.Errorf("no servers in the pool")
return nil, errors.New("no servers in the pool")
}
if len(b.status) == 0 {
return nil, errNoAvailableServer
@ -252,5 +252,5 @@ func hash(input string) string {
// We purposely ignore the error because the implementation always returns nil.
_, _ = hasher.Write([]byte(input))
return fmt.Sprintf("%x", hasher.Sum64())
return strconv.FormatUint(hasher.Sum64(), 16)
}