all: use errors.New() which has no param instead of fmt.Errorf()

This commit is contained in:
yzb@example.cn 2024-03-02 15:57:34 +08:00 committed by yasyzb
parent f0ea96f2e4
commit f62d3e0d0f
No known key found for this signature in database
GPG key ID: EB61E18B54E78C76
3 changed files with 14 additions and 11 deletions

View file

@ -9,12 +9,13 @@ package vault_auth_tee
import (
"crypto/tls"
"fmt"
"gitlab.com/hacklunch/ntp"
"gitlab.com/hacklunch/ntske"
"errors"
"log"
"math/rand"
"time"
"gitlab.com/hacklunch/ntp"
"gitlab.com/hacklunch/ntske"
)
// Gets the rough network time using NTS-KE.
@ -105,11 +106,11 @@ func getRoughNtsUnixTime() (time.Time, error) {
}
if queried < numToQuery {
return retTime, fmt.Errorf("failed to query enough servers")
return retTime, errors.New("failed to query enough servers")
}
if sumOffset > time.Minute {
return retTime, fmt.Errorf("queried time fluctuates too much")
return retTime, errors.New("queried time fluctuates too much")
}
return retTime, nil