From 8a74dcafb5718a855951d7f01774f816771954fb Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Mon, 17 Feb 2020 16:30:18 +0000 Subject: [PATCH] Merge PR #5656: Make golangci-lint happy again --- types/rest/rest.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/types/rest/rest.go b/types/rest/rest.go index 0a2f6486a8..a6339097e7 100644 --- a/types/rest/rest.go +++ b/types/rest/rest.go @@ -20,8 +20,8 @@ import ( ) const ( - DefaultPage = 1 - DefaultLimit = 30 // should be consistent with tendermint/tendermint/rpc/core/pipe.go:19 + DefaultPage = 1 + DefaultLimit = 30 // should be consistent with tendermint/tendermint/rpc/core/pipe.go:19 TxMinHeightKey = "tx.minheight" // Inclusive minimum 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 - if key == types.TxHeightKey { + switch key { + case types.TxHeightKey: tag = fmt.Sprintf("%s=%s", key, value) - } else if key == TxMinHeightKey { + case TxMinHeightKey: tag = fmt.Sprintf("%s>=%s", types.TxHeightKey, value) - } else if key == TxMaxHeightKey { + case TxMaxHeightKey: tag = fmt.Sprintf("%s<=%s", types.TxHeightKey, value) - } else { + default: tag = fmt.Sprintf("%s='%s'", key, value) } tags = append(tags, tag)