mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-13 03:24:28 +00:00
gocritic (1/2) (#3836)
Add gocritic as a linter
The linting is not complete, but should i complete in this PR or in a following.
23 files have been touched so it may be better to do in a following PR
Commits:
* Add gocritic to linting
- Added gocritic to linting
Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>
* gocritic
* pr comments
* remove switch in cmdBatch
This commit is contained in:
@@ -51,11 +51,12 @@ func IsASCIIText(s string) bool {
|
||||
func ASCIITrim(s string) string {
|
||||
r := make([]byte, 0, len(s))
|
||||
for _, b := range []byte(s) {
|
||||
if b == 32 {
|
||||
switch {
|
||||
case b == 32:
|
||||
continue // skip space
|
||||
} else if 32 < b && b <= 126 {
|
||||
case 32 < b && b <= 126:
|
||||
r = append(r, b)
|
||||
} else {
|
||||
default:
|
||||
panic(fmt.Sprintf("non-ASCII (non-tab) char 0x%X", b))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user