Skip to content

Commit

Permalink
fix linter errors (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
visill authored Aug 20, 2024
1 parent 545353d commit e898f12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pkg/auth/krb5.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions pkg/models/spqrerror/spqrerror.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion router/statistics/query_time_statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e898f12

Please sign in to comment.