Merge PR #5656: Make golangci-lint happy again

This commit is contained in:
Alessio Treglia 2020-02-17 16:30:18 +00:00 committed by GitHub
parent 5ee65cb897
commit 8a74dcafb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -20,8 +20,8 @@ import (
) )
const ( const (
DefaultPage = 1 DefaultPage = 1
DefaultLimit = 30 // should be consistent with tendermint/tendermint/rpc/core/pipe.go:19 DefaultLimit = 30 // should be consistent with tendermint/tendermint/rpc/core/pipe.go:19
TxMinHeightKey = "tx.minheight" // Inclusive minimum height filter TxMinHeightKey = "tx.minheight" // Inclusive minimum height filter
TxMaxHeightKey = "tx.maxheight" // Inclusive maximum height filter TxMaxHeightKey = "tx.maxheight" // Inclusive maximum height filter
) )
@ -337,13 +337,14 @@ func ParseHTTPArgsWithLimit(r *http.Request, defaultLimit int) (tags []string, p
} }
var tag string var tag string
if key == types.TxHeightKey { switch key {
case types.TxHeightKey:
tag = fmt.Sprintf("%s=%s", key, value) tag = fmt.Sprintf("%s=%s", key, value)
} else if key == TxMinHeightKey { case TxMinHeightKey:
tag = fmt.Sprintf("%s>=%s", types.TxHeightKey, value) tag = fmt.Sprintf("%s>=%s", types.TxHeightKey, value)
} else if key == TxMaxHeightKey { case TxMaxHeightKey:
tag = fmt.Sprintf("%s<=%s", types.TxHeightKey, value) tag = fmt.Sprintf("%s<=%s", types.TxHeightKey, value)
} else { default:
tag = fmt.Sprintf("%s='%s'", key, value) tag = fmt.Sprintf("%s='%s'", key, value)
} }
tags = append(tags, tag) tags = append(tags, tag)