Skip to content

Commit b649630

Browse files
committed
linting
1 parent 533cf93 commit b649630

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

cmd/convert/hexadecimal_to_decimal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func GetConvertHexadecimalToDecimalCmd() *cobra.Command {
3939
if !ok {
4040
panic("failed to convert string to decimal")
4141
}
42-
fmt.Println(fmt.Sprintf("0x%x", bi))
42+
fmt.Printf("0x%x\n", bi)
4343
} else {
4444
// is hex without 0x
4545
fmt.Println("# Hex to Dec:")

cmd/convert/solc_sig.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ func normalizeEvmEventOrMethodInterface(_interface string) string {
100100
// trim either prefix 'function ', 'event '
101101
if strings.HasPrefix(_interface, "function ") {
102102
_interface = strings.TrimPrefix(_interface, "function ")
103-
} else if strings.HasPrefix(_interface, "event ") {
103+
} else {
104104
_interface = strings.TrimPrefix(_interface, "event ")
105105
}
106-
strings.TrimSpace(_interface)
106+
_interface = strings.TrimSpace(_interface)
107107

108108
// ...
109109

@@ -184,7 +184,7 @@ func prepareInterfaceToHash(_interface string) (res string, err error) {
184184

185185
func removeExtraSpaces(str string) string {
186186
var passOne bool
187-
for true {
187+
for {
188188
var replacedAny bool
189189
if strings.Contains(str, " ") {
190190
passOne = false

cmd/debug/intrinsic_gas.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ func GetIntrinsicCommand() *cobra.Command {
2525
libutils.PrintlnStdErr("ERR: invalid EVM transaction input data format")
2626
os.Exit(1)
2727
}
28-
if strings.HasPrefix(input, "0x") {
29-
input = input[2:]
30-
}
28+
29+
input = strings.TrimPrefix(input, "0x")
3130
if len(input)%2 != 0 {
3231
libutils.PrintlnStdErr("ERR: invalid EVM transaction input string length", len(input), ", must be an even number of characters")
3332
os.Exit(1)

0 commit comments

Comments
 (0)