diff --git a/pkg/auth/krb5.go b/pkg/auth/krb5.go index 266d7d9dc..6aa961e6d 100644 --- a/pkg/auth/krb5.go +++ b/pkg/auth/krb5.go @@ -3,13 +3,14 @@ package auth import ( "encoding/hex" "fmt" + "log" + "github.com/jackc/pgx/v5/pgproto3" "github.com/jcmturner/gokrb5/v8/credentials" "github.com/jcmturner/gokrb5/v8/gssapi" "github.com/jcmturner/gokrb5/v8/keytab" "github.com/jcmturner/gokrb5/v8/service" "github.com/pg-sharding/spqr/pkg/client" - "log" ) type BaseAuthModule struct { @@ -96,7 +97,7 @@ func (k *Kerberos) Process(cl client.Client) (cred *credentials.Credentials, err if status.Code == gssapi.StatusContinueNeeded { errText := "Kerberos GSS-API continue needed" log.Print(errText) - return nil, fmt.Errorf(errText) + return nil, fmt.Errorf("%s", errText) } if authed { ctx := st.Context() diff --git a/pkg/models/spqrerror/spqrerror.go b/pkg/models/spqrerror/spqrerror.go index e73f2493f..bbaab6fce 100644 --- a/pkg/models/spqrerror/spqrerror.go +++ b/pkg/models/spqrerror/spqrerror.go @@ -79,7 +79,7 @@ type SpqrError struct { // - *SpqrError: The created SpqrError. func New(errorCode string, errorMsg string) *SpqrError { err := &SpqrError{ - Err: fmt.Errorf(errorMsg), + Err: fmt.Errorf("%s", errorMsg), ErrorCode: errorCode, } return err @@ -95,7 +95,7 @@ func New(errorCode string, errorMsg string) *SpqrError { // - *SpqrError: The created SpqrError. func NewByCode(errorCode string) *SpqrError { err := &SpqrError{ - Err: fmt.Errorf(GetMessageByCode(errorCode)), + Err: fmt.Errorf("%s", GetMessageByCode(errorCode)), ErrorCode: errorCode, } return err diff --git a/router/statistics/query_time_statistics.go b/router/statistics/query_time_statistics.go index fdd876b4f..6f306d123 100644 --- a/router/statistics/query_time_statistics.go +++ b/router/statistics/query_time_statistics.go @@ -38,7 +38,8 @@ var queryStatistics = statistics{ func InitStatistics(q []float64) { queryStatistics.Quantiles = q - if queryStatistics.Quantiles != nil && len(queryStatistics.Quantiles) > 0 { + + if len(queryStatistics.Quantiles) > 0 { // also not nil queryStatistics.NeedToCollectData = false } else { queryStatistics.NeedToCollectData = true