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

@ -2,6 +2,7 @@ package http
import (
"context"
"errors"
"fmt"
"hash/fnv"
"io"
@ -41,11 +42,11 @@ func (p *Provider) SetDefaults() {
// Init the provider.
func (p *Provider) Init() error {
if p.Endpoint == "" {
return fmt.Errorf("non-empty endpoint is required")
return errors.New("non-empty endpoint is required")
}
if p.PollInterval <= 0 {
return fmt.Errorf("poll interval must be greater than 0")
return errors.New("poll interval must be greater than 0")
}
p.httpClient = &http.Client{