all: fix some go-critic linter warnings (#23709)

This doesn't fix all go-critic warnings, just the most serious ones.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
Iskander (Alex) Sharipov
2021-10-13 18:31:02 +03:00
committed by GitHub
parent e4f570fcc6
commit 778ff94794
8 changed files with 35 additions and 38 deletions

View File

@ -29,6 +29,7 @@ import (
"strconv"
"strings"
"unicode"
"unicode/utf8"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
@ -100,7 +101,8 @@ func (t *Type) isReferenceType() bool {
return false
}
// Reference types must have a leading uppercase character
return unicode.IsUpper([]rune(t.Type)[0])
r, _ := utf8.DecodeRuneInString(t.Type)
return unicode.IsUpper(r)
}
type Types map[string][]Type