From f2da6581ba827a2aab091f764ace8017b26450d8 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 6 Jan 2017 16:44:20 +0100 Subject: all: fix issues reported by honnef.co/go/simple/cmd/gosimple --- accounts/abi/bind/bind.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'accounts/abi/bind') diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index 84cf22e3c..73e95e02a 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -147,21 +147,21 @@ func bindTypeGo(kind abi.Type) string { switch { case strings.HasPrefix(stringKind, "address"): - parts := regexp.MustCompile("address(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`address(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 2 { return stringKind } return fmt.Sprintf("%scommon.Address", parts[1]) case strings.HasPrefix(stringKind, "bytes"): - parts := regexp.MustCompile("bytes([0-9]*)(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`bytes([0-9]*)(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 3 { return stringKind } return fmt.Sprintf("%s[%s]byte", parts[2], parts[1]) case strings.HasPrefix(stringKind, "int") || strings.HasPrefix(stringKind, "uint"): - parts := regexp.MustCompile("(u)?int([0-9]*)(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`(u)?int([0-9]*)(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 4 { return stringKind } @@ -172,7 +172,7 @@ func bindTypeGo(kind abi.Type) string { return fmt.Sprintf("%s*big.Int", parts[3]) case strings.HasPrefix(stringKind, "bool") || strings.HasPrefix(stringKind, "string"): - parts := regexp.MustCompile("([a-z]+)(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`([a-z]+)(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 3 { return stringKind } @@ -191,7 +191,7 @@ func bindTypeJava(kind abi.Type) string { switch { case strings.HasPrefix(stringKind, "address"): - parts := regexp.MustCompile("address(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`address(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 2 { return stringKind } @@ -201,7 +201,7 @@ func bindTypeJava(kind abi.Type) string { return fmt.Sprintf("Addresses") case strings.HasPrefix(stringKind, "bytes"): - parts := regexp.MustCompile("bytes([0-9]*)(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`bytes([0-9]*)(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 3 { return stringKind } @@ -211,7 +211,7 @@ func bindTypeJava(kind abi.Type) string { return "byte[]" case strings.HasPrefix(stringKind, "int") || strings.HasPrefix(stringKind, "uint"): - parts := regexp.MustCompile("(u)?int([0-9]*)(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`(u)?int([0-9]*)(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 4 { return stringKind } @@ -230,7 +230,7 @@ func bindTypeJava(kind abi.Type) string { return fmt.Sprintf("BigInts") case strings.HasPrefix(stringKind, "bool"): - parts := regexp.MustCompile("bool(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`bool(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 2 { return stringKind } @@ -240,7 +240,7 @@ func bindTypeJava(kind abi.Type) string { return fmt.Sprintf("bool[]") case strings.HasPrefix(stringKind, "string"): - parts := regexp.MustCompile("string(\\[[0-9]*\\])?").FindStringSubmatch(stringKind) + parts := regexp.MustCompile(`string(\[[0-9]*\])?`).FindStringSubmatch(stringKind) if len(parts) != 2 { return stringKind } @@ -278,7 +278,7 @@ func namedTypeJava(javaKind string, solKind abi.Type) string { case "bool[]": return "Bools" case "BigInt": - parts := regexp.MustCompile("(u)?int([0-9]*)(\\[[0-9]*\\])?").FindStringSubmatch(solKind.String()) + parts := regexp.MustCompile(`(u)?int([0-9]*)(\[[0-9]*\])?`).FindStringSubmatch(solKind.String()) if len(parts) != 4 { return javaKind } -- cgit v1.2.3