Skip to content

Commit

Permalink
Apply changes implied by linter
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hollands <[email protected]>
  • Loading branch information
MichelHollands committed Apr 5, 2024
1 parent 01c0803 commit b64be21
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions clients/pkg/logentry/stages/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func (m *metricStage) Name() string {
}

// recordCounter will update a counter metric
// nolint:goconst
func (m *metricStage) recordCounter(name string, counter *metric.Counters, labels model.LabelSet, v interface{}) {
// If value matching is defined, make sure value matches.
if counter.Cfg.Value != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/logcli/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ func (c *DefaultClient) doRequest(path, query string, quiet bool, out interface{
return json.NewDecoder(resp.Body).Decode(out)
}

// nolint:goconst
func (c *DefaultClient) getHTTPRequestHeader() (http.Header, error) {
h := make(http.Header)

Expand Down
5 changes: 2 additions & 3 deletions pkg/logcli/query/part_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ func (f *PartFile) Exists() (bool, error) {
} else if errors.Is(err, os.ErrNotExist) {
// File does not exist.
return false, nil
} else {
// Unclear if file exists or not, we cannot stat it.
return false, fmt.Errorf("failed to check if part file exists: %s: %s", f.finalName, err)
}
// Unclear if file exists or not, we cannot stat it.
return false, fmt.Errorf("failed to check if part file exists: %s: %s", f.finalName, err)
}

// CreateTempFile creates the temp file to store the data before Finalize is called.
Expand Down
3 changes: 1 addition & 2 deletions pkg/logql/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,8 @@ func matchingSignature(sample promql.Sample, opts *syntax.BinOpOptions) uint64 {
return sample.Metric.Hash()
} else if opts.VectorMatching.On {
return labels.NewBuilder(sample.Metric).Keep(opts.VectorMatching.MatchingLabels...).Labels().Hash()
} else {
return labels.NewBuilder(sample.Metric).Del(opts.VectorMatching.MatchingLabels...).Labels().Hash()
}
return labels.NewBuilder(sample.Metric).Del(opts.VectorMatching.MatchingLabels...).Labels().Hash()
}

func vectorBinop(op string, opts *syntax.BinOpOptions, lhs, rhs promql.Vector, lsigs, rsigs []uint64) (promql.Vector, error) {
Expand Down
5 changes: 2 additions & 3 deletions pkg/querier/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,9 @@ func (q *QuerierAPI) TailHandler(w http.ResponseWriter, r *http.Request) {
break
} else if tailer.stopped {
return
} else {
level.Error(logger).Log("msg", "Unexpected error from client", "err", err)
break
}
level.Error(logger).Log("msg", "Unexpected error from client", "err", err)
break
}
}
doneChan <- struct{}{}
Expand Down
3 changes: 1 addition & 2 deletions pkg/querier/queryrange/querysharding.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,8 @@ func (confs ShardingConfigs) ValidRange(start, end int64) (config.PeriodConfig,
} else if end < int64(confs[i+1].From.Time) {
// The request is entirely scoped into this shard config
return conf, nil
} else {
continue
}
continue
}

return config.PeriodConfig{}, errInvalidShardingRange
Expand Down
1 change: 1 addition & 0 deletions tools/doc-generator/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (w *specWriter) writeConfigBlock(b *parse.ConfigBlock, indent int) {
}
}

// nolint:goconst
func (w *specWriter) writeConfigEntry(e *parse.ConfigEntry, indent int) {
if e.Kind == parse.KindBlock {
// If the block is a root block it will have its dedicated section in the doc,
Expand Down

0 comments on commit b64be21

Please sign in to comment.