Skip to content

Commit

Permalink
chore: Lint in prep for golangci compatible with Go 1.23 (#14289)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul1r authored Sep 26, 2024
1 parent f39cdbd commit 04f87ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions pkg/logql/syntax/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func ExtractLabelFiltersBeforeParser(e Expr) []*LabelFilterExpr {
)

visitor := &DepthFirstTraversal{
VisitLabelFilterFn: func(v RootVisitor, e *LabelFilterExpr) {
VisitLabelFilterFn: func(_ RootVisitor, e *LabelFilterExpr) {
if !foundParseStage {
filters = append(filters, e)
}
Expand All @@ -94,13 +94,13 @@ func ExtractLabelFiltersBeforeParser(e Expr) []*LabelFilterExpr {
// expression is added without updating this list, blooms can silently
// misbehave.

VisitLogfmtParserFn: func(v RootVisitor, e *LogfmtParserExpr) { foundParseStage = true },
VisitLabelParserFn: func(v RootVisitor, e *LabelParserExpr) { foundParseStage = true },
VisitJSONExpressionParserFn: func(v RootVisitor, e *JSONExpressionParser) { foundParseStage = true },
VisitLogfmtExpressionParserFn: func(v RootVisitor, e *LogfmtExpressionParser) { foundParseStage = true },
VisitLabelFmtFn: func(v RootVisitor, e *LabelFmtExpr) { foundParseStage = true },
VisitKeepLabelFn: func(v RootVisitor, e *KeepLabelsExpr) { foundParseStage = true },
VisitDropLabelsFn: func(v RootVisitor, e *DropLabelsExpr) { foundParseStage = true },
VisitLogfmtParserFn: func(_ RootVisitor, _ *LogfmtParserExpr) { foundParseStage = true },
VisitLabelParserFn: func(_ RootVisitor, _ *LabelParserExpr) { foundParseStage = true },
VisitJSONExpressionParserFn: func(_ RootVisitor, _ *JSONExpressionParser) { foundParseStage = true },
VisitLogfmtExpressionParserFn: func(_ RootVisitor, _ *LogfmtExpressionParser) { foundParseStage = true },
VisitLabelFmtFn: func(_ RootVisitor, _ *LabelFmtExpr) { foundParseStage = true },
VisitKeepLabelFn: func(_ RootVisitor, _ *KeepLabelsExpr) { foundParseStage = true },
VisitDropLabelsFn: func(_ RootVisitor, _ *DropLabelsExpr) { foundParseStage = true },
}
e.Accept(visitor)
return filters
Expand Down
14 changes: 7 additions & 7 deletions pkg/querier/queryrange/detected_fields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ func TestQuerier_DetectedFields(t *testing.T) {

limitedHandler := func(stream logproto.Stream) base.Handler {
return base.HandlerFunc(
func(ctx context.Context, req base.Request) (base.Response, error) {
func(_ context.Context, _ base.Request) (base.Response, error) {
return &LokiResponse{
Status: "success",
Data: LokiData{
Expand All @@ -985,7 +985,7 @@ func TestQuerier_DetectedFields(t *testing.T) {

logHandler := func(stream logproto.Stream) base.Handler {
return base.HandlerFunc(
func(ctx context.Context, req base.Request) (base.Response, error) {
func(_ context.Context, _ base.Request) (base.Response, error) {
return &LokiResponse{
Status: "success",
Data: LokiData{
Expand Down Expand Up @@ -1028,7 +1028,7 @@ func TestQuerier_DetectedFields(t *testing.T) {
limitedHandler(mockLogfmtStreamWithLabels(1, 5, `{type="test", name="foo"}`)),
logHandler(mockLogfmtStreamWithLabels(1, 5, `{type="test", name="foo"}`)),
limits,
).Wrap(base.HandlerFunc(func(ctx context.Context, req base.Request) (base.Response, error) {
).Wrap(base.HandlerFunc(func(_ context.Context, _ base.Request) (base.Response, error) {
t.Fatal("should not be called")
return nil, nil
}))
Expand Down Expand Up @@ -1058,7 +1058,7 @@ func TestQuerier_DetectedFields(t *testing.T) {
limitedHandler(mockLogfmtStreamWithLabelsAndStructuredMetadata(1, 5, `{type="test", name="bob"}`)),
logHandler(mockLogfmtStreamWithLabelsAndStructuredMetadata(1, 5, `{type="test", name="bob"}`)),
limits,
).Wrap(base.HandlerFunc(func(ctx context.Context, req base.Request) (base.Response, error) {
).Wrap(base.HandlerFunc(func(_ context.Context, _ base.Request) (base.Response, error) {
t.Fatal("should not be called")
return nil, nil
}))
Expand Down Expand Up @@ -1090,7 +1090,7 @@ func TestQuerier_DetectedFields(t *testing.T) {
limitedHandler(mockLogfmtStreamWithLabels(1, 2, `{type="test", name="foo"}`)),
logHandler(mockLogfmtStreamWithLabels(1, 2, `{type="test", name="foo"}`)),
limits,
).Wrap(base.HandlerFunc(func(ctx context.Context, req base.Request) (base.Response, error) {
).Wrap(base.HandlerFunc(func(_ context.Context, _ base.Request) (base.Response, error) {
t.Fatal("should not be called")
return nil, nil
}))
Expand Down Expand Up @@ -1136,7 +1136,7 @@ func TestQuerier_DetectedFields(t *testing.T) {
),
logHandler(mockLogfmtStreamWithLabelsAndStructuredMetadata(1, 2, `{type="test"}`)),
limits,
).Wrap(base.HandlerFunc(func(ctx context.Context, req base.Request) (base.Response, error) {
).Wrap(base.HandlerFunc(func(_ context.Context, _ base.Request) (base.Response, error) {
t.Fatal("should not be called")
return nil, nil
}))
Expand Down Expand Up @@ -1188,7 +1188,7 @@ func TestQuerier_DetectedFields(t *testing.T) {
),
logHandler(mockLogfmtStreamWithLabelsAndStructuredMetadata(1, 2, `{type="test", name="bob"}`)),
limits,
).Wrap(base.HandlerFunc(func(ctx context.Context, req base.Request) (base.Response, error) {
).Wrap(base.HandlerFunc(func(_ context.Context, _ base.Request) (base.Response, error) {
t.Fatal("should not be called")
return nil, nil
}))
Expand Down

0 comments on commit 04f87ca

Please sign in to comment.