linters: enable stylecheck (#4153)

Refs #3262
This commit is contained in:
Anton Kaliaev
2019-11-16 19:35:39 +04:00
committed by GitHub
parent 36ba1a8494
commit 3e1516b624
137 changed files with 590 additions and 589 deletions

View File

@@ -15,11 +15,11 @@ var (
dotAtom = atom + `(?:\.` + atom + `)*`
domain = `[A-Z0-9.-]+\.[A-Z]{2,4}`
RE_INT = regexp.MustCompile(`^-?[0-9]+$`)
RE_HEX = regexp.MustCompile(`^(?i)[a-f0-9]+$`)
RE_EMAIL = regexp.MustCompile(`^(?i)(` + dotAtom + `)@(` + dotAtom + `)$`)
RE_ADDRESS = regexp.MustCompile(`^(?i)[a-z0-9]{25,34}$`)
RE_HOST = regexp.MustCompile(`^(?i)(` + domain + `)$`)
ReInt = regexp.MustCompile(`^-?[0-9]+$`)
ReHex = regexp.MustCompile(`^(?i)[a-f0-9]+$`)
ReEmail = regexp.MustCompile(`^(?i)(` + dotAtom + `)@(` + dotAtom + `)$`)
ReAddress = regexp.MustCompile(`^(?i)[a-z0-9]{25,34}$`)
ReHost = regexp.MustCompile(`^(?i)(` + domain + `)$`)
//RE_ID12 = regexp.MustCompile(`^[a-zA-Z0-9]{12}$`)
)

View File

@@ -130,7 +130,7 @@ func nonJSONStringToArg(cdc *amino.Codec, rt reflect.Type, arg string) (reflect.
// NOTE: rt.Kind() isn't a pointer.
func _nonJSONStringToArg(cdc *amino.Codec, rt reflect.Type, arg string) (reflect.Value, bool, error) {
isIntString := RE_INT.Match([]byte(arg))
isIntString := ReInt.Match([]byte(arg))
isQuotedString := strings.HasPrefix(arg, `"`) && strings.HasSuffix(arg, `"`)
isHexString := strings.HasPrefix(strings.ToLower(arg), "0x")