Skip to content

Commit

Permalink
Migrate to GitHubAction for GolangCI Lint
Browse files Browse the repository at this point in the history
This fixes the issues related to GolangCI Lint.
  • Loading branch information
khrm committed Jan 17, 2025
1 parent 3c7dd2e commit 3f2a342
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions pkg/api/server/cel2sql/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ func (i *interpreter) interpretExpr(expr *exprpb.Expr) error {
func (i *interpreter) unsupportedExprError(id int64, name string) error {
sourceInfo := i.checkedExpr.SourceInfo
column := sourceInfo.Positions[id]
var line int32
var line int
for i, offset := range sourceInfo.LineOffsets {
line = int32(i) + 1
line = i + 1
if offset > column {
break
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type Config struct {
LOGGING_PLUGIN_CA_CERT string `mapstructure:"LOGGING_PLUGIN_CA_CERT"`
LOGGING_PLUGIN_QUERY_LIMIT uint `mapstructure:"LOGGING_PLUGIN_QUERY_LIMIT"`
LOGGING_PLUGIN_TLS_VERIFICATION_DISABLE bool `mapstructure:"LOGGING_PLUGIN_TLS_VERIFICATION_DISABLE"`
LOGGING_PLUGIN_FORWARDER_DELAY_DURATION uint `mapstructure:"LOGGING_PLUGIN_FORWARDER_DELAY_DURATION"`
LOGGING_PLUGIN_FORWARDER_DELAY_DURATION int64 `mapstructure:"LOGGING_PLUGIN_FORWARDER_DELAY_DURATION"`
LOGGING_PLUGIN_QUERY_PARAMS string `mapstructure:"LOGGING_PLUGIN_QUERY_PARAMS"`
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/api/server/db/pagination/pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ type Batcher struct {
}

// NewBatcher creates a new batcher for the given requested page size.
func NewBatcher(want, min, max int) *Batcher {
func NewBatcher(want, mini, maxi int) *Batcher {
return &Batcher{
want: want,
min: min,
max: max,
min: mini,
max: maxi,
ratio: 1,
}
}
Expand Down
5 changes: 2 additions & 3 deletions pkg/api/server/v1alpha2/log/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"

"context"
"fmt"
"io"

"github.com/aws/aws-sdk-go-v2/aws"
Expand Down Expand Up @@ -141,15 +140,15 @@ func (s3s *s3Stream) WriteTo(w io.Writer) (n int64, err error) {
Key: &s3s.key,
})
if err != nil {
return 0, fmt.Errorf(err.Error())
return 0, err
}

defer outPut.Body.Close()

reader := bufio.NewReaderSize(outPut.Body, s3s.size)
n, err = reader.WriteTo(w)
if err != nil {
return 0, fmt.Errorf(err.Error())
return 0, err
}
return
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/server/v1alpha2/ordering_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestOrderBy(t *testing.T) {
t.Errorf("unexpected error: %v", err)
}
if ob != tc.out {
t.Errorf(diff.PrintWantGot(cmp.Diff(tc.out, ob)))
t.Error(diff.PrintWantGot(cmp.Diff(tc.out, ob)))
}
}
}
Expand Down Expand Up @@ -70,7 +70,7 @@ func TestNormalizeOrderByField(t *testing.T) {
t.Errorf("unexpected error: %v", err)
}
if n != tc.out {
t.Errorf(diff.PrintWantGot(cmp.Diff(tc.out, n)))
t.Error(diff.PrintWantGot(cmp.Diff(tc.out, n)))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/server/v1alpha2/plugin/plugin_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func getLokiLogs(s *LogServer, writer io.Writer, parent string, rec *db.Record)
parameters.Add("query", `{ `+s.staticLabels+s.config.LOGGING_PLUGIN_NAMESPACE_KEY+`="`+parent+`" }|json uid="`+uidKey+`", message="message" |uid="`+rec.Name+`"| line_format "{{.message}}"`)
parameters.Add("end", endTime)
parameters.Add("start", startTime)
parameters.Add("limit", strconv.Itoa(int(s.queryLimit)))
parameters.Add("limit", strconv.FormatUint(uint64(s.queryLimit), 10))

URL.RawQuery = parameters.Encode()
s.logger.Debugf("loki request url:%s", URL.String())
Expand Down

0 comments on commit 3f2a342

Please sign in to comment.