Update to go1.22
Co-authored-by: Julien Salleyron <julien.salleyron@gmail.com>
This commit is contained in:
parent
e11ff98608
commit
d5cb9b50f4
56 changed files with 4189 additions and 3419 deletions
|
@ -1,7 +1,7 @@
|
|||
package tcp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Constructor A constructor for a piece of TCP middleware.
|
||||
|
@ -29,7 +29,7 @@ func NewChain(constructors ...Constructor) Chain {
|
|||
// Then adds an handler at the end of the chain.
|
||||
func (c Chain) Then(h Handler) (Handler, error) {
|
||||
if h == nil {
|
||||
return nil, fmt.Errorf("cannot add a nil handler to the chain")
|
||||
return nil, errors.New("cannot add a nil handler to the chain")
|
||||
}
|
||||
|
||||
for i := range c.constructors {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package tcp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
"sync"
|
||||
|
||||
"github.com/traefik/traefik/v2/pkg/log"
|
||||
|
@ -91,7 +91,7 @@ func gcd(a, b int) int {
|
|||
|
||||
func (b *WRRLoadBalancer) next() (Handler, error) {
|
||||
if len(b.servers) == 0 {
|
||||
return nil, fmt.Errorf("no servers in the pool")
|
||||
return nil, errors.New("no servers in the pool")
|
||||
}
|
||||
|
||||
// The algo below may look messy, but is actually very simple
|
||||
|
@ -101,7 +101,7 @@ func (b *WRRLoadBalancer) next() (Handler, error) {
|
|||
// Maximum weight across all enabled servers
|
||||
max := b.maxWeight()
|
||||
if max == 0 {
|
||||
return nil, fmt.Errorf("all servers have 0 weight")
|
||||
return nil, errors.New("all servers have 0 weight")
|
||||
}
|
||||
|
||||
// GCD across all enabled servers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue