golangci-lint: remove skip-cache and restore singleCaseSwitch rule

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL 2023-04-20 18:43:51 +02:00 committed by GitHub
parent 78cd9ae2c3
commit 7e9acc2e46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 10 deletions

View file

@ -150,7 +150,6 @@ jobs:
uses: golangci/golangci-lint-action@v3.4.0
with:
args: --verbose
skip-cache: true
version: v1.51.2
fuzzing:
uses: ./.github/workflows/fuzzing.yml

View file

@ -24,9 +24,6 @@ issues:
- linters:
- gocritic
text: "appendAssign"
- linters:
- gocritic
text: "singleCaseSwitch"
- path: _test.go
linters:
- errcheck

View file

@ -757,8 +757,7 @@ func subqueryTimes(path []parser.Node) (time.Duration, time.Duration, *int64) {
ts int64 = math.MaxInt64
)
for _, node := range path {
switch n := node.(type) {
case *parser.SubqueryExpr:
if n, ok := node.(*parser.SubqueryExpr); ok {
subqOffset += n.OriginalOffset
subqRange += n.Range
if n.Timestamp != nil {
@ -847,8 +846,7 @@ func (ng *Engine) getTimeRangesForSelector(s *parser.EvalStmt, n *parser.VectorS
func (ng *Engine) getLastSubqueryInterval(path []parser.Node) time.Duration {
var interval time.Duration
for _, node := range path {
switch n := node.(type) {
case *parser.SubqueryExpr:
if n, ok := node.(*parser.SubqueryExpr); ok {
interval = n.Step
if n.Step == 0 {
interval = time.Duration(ng.noStepSubqueryIntervalFn(durationMilliseconds(n.Range))) * time.Millisecond
@ -914,8 +912,7 @@ func extractGroupsFromPath(p []parser.Node) (bool, []string) {
if len(p) == 0 {
return false, nil
}
switch n := p[len(p)-1].(type) {
case *parser.AggregateExpr:
if n, ok := p[len(p)-1].(*parser.AggregateExpr); ok {
return !n.Without, n.Grouping
}
return false, nil