Skip to content

Commit 085fc78

Browse files
authored
lint: Fix linter warnings (#2065)
1 parent 7b04505 commit 085fc78

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed

cmd/evm/internal/t8ntool/transition.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ func (t *txWithKey) UnmarshalJSON(input []byte) error {
323323
// signUnsignedTransactions converts the input txs to canonical transactions.
324324
//
325325
// The transactions can have two forms, either
326-
// 1. unsigned or
327-
// 2. signed
326+
// 1. unsigned or
327+
// 2. signed
328+
//
328329
// For (1), r, s, v, need so be zero, and the `secretKey` needs to be set.
329330
// If so, we sign it here and now, with the given `secretKey`
330331
// If the condition above is not met, then it's considered a signed transaction.

common/fdlimit/fdlimit_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package fdlimit
1818

1919
import (
20-
"fmt"
2120
"testing"
2221
)
2322

@@ -30,7 +29,7 @@ func TestFileDescriptorLimits(t *testing.T) {
3029
t.Fatal(err)
3130
}
3231
if hardlimit < target {
33-
t.Skip(fmt.Sprintf("system limit is less than desired test target: %d < %d", hardlimit, target))
32+
t.Skipf("system limit is less than desired test target: %d < %d", hardlimit, target)
3433
}
3534

3635
if limit, err := Current(); err != nil || limit <= 0 {

core/vm/contracts_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func benchmarkPrecompiled(addr string, test precompiledTest, bench *testing.B) {
406406
return
407407
}
408408
if common.Bytes2Hex(res) != test.Expected {
409-
bench.Error(fmt.Sprintf("Expected %v, got %v", test.Expected, common.Bytes2Hex(res)))
409+
bench.Errorf("Expected %v, got %v", test.Expected, common.Bytes2Hex(res))
410410
return
411411
}
412412
})

internal/build/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func MustRun(cmd *exec.Cmd) {
4444
cmd.Stdout = os.Stdout
4545
if err := cmd.Run(); err != nil {
4646
log.Printf("Command failed \"%s\", err: \"%v\"", strings.Join(cmd.Args, " "), err)
47-
log.Fatal(fmt.Sprintf("Command failed \"%s\", err: \"%v\"", strings.Join(cmd.Args, " "), err))
47+
log.Fatalf("Command failed \"%s\", err: \"%v\"", strings.Join(cmd.Args, " "), err)
4848
}
4949
}
5050
}

trie/proof.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ findFork:
335335
// unset removes all internal node references either the left most or right most.
336336
// It can meet these scenarios:
337337
//
338-
// - The given path is existent in the trie, unset the associated nodes with the
339-
// specific direction
340-
// - The given path is non-existent in the trie
338+
// - The given path is existent in the trie, unset the associated nodes with the
339+
// specific direction
340+
// - The given path is non-existent in the trie
341341
// - the fork point is a fullnode, the corresponding child pointed by path
342342
// is nil, return
343343
// - the fork point is a shortnode, the shortnode is included in the range,
@@ -454,15 +454,15 @@ func hasRightElement(node node, key []byte) bool {
454454
// Expect the normal case, this function can also be used to verify the following
455455
// range proofs:
456456
//
457-
// - All elements proof. In this case the proof can be nil, but the range should
458-
// be all the leaves in the trie.
457+
// - All elements proof. In this case the proof can be nil, but the range should
458+
// be all the leaves in the trie.
459459
//
460-
// - One element proof. In this case no matter the edge proof is a non-existent
461-
// proof or not, we can always verify the correctness of the proof.
460+
// - One element proof. In this case no matter the edge proof is a non-existent
461+
// proof or not, we can always verify the correctness of the proof.
462462
//
463-
// - Zero element proof. In this case a single non-existent proof is enough to prove.
464-
// Besides, if there are still some other leaves available on the right side, then
465-
// an error will be returned.
463+
// - Zero element proof. In this case a single non-existent proof is enough to prove.
464+
// Besides, if there are still some other leaves available on the right side, then
465+
// an error will be returned.
466466
//
467467
// Except returning the error to indicate the proof is valid or not, the function will
468468
// also return a flag to indicate whether there exists more accounts/slots in the trie.

trie/stacktrie.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,12 @@ func (st *StackTrie) insert(key, value []byte) {
363363
// hash() hashes the node 'st' and converts it into 'hashedNode', if possible.
364364
// Possible outcomes:
365365
// 1. The rlp-encoded value was >= 32 bytes:
366-
// - Then the 32-byte `hash` will be accessible in `st.val`.
367-
// - And the 'st.type' will be 'hashedNode'
366+
// - Then the 32-byte `hash` will be accessible in `st.val`.
367+
// - And the 'st.type' will be 'hashedNode'
368+
//
368369
// 2. The rlp-encoded value was < 32 bytes
369-
// - Then the <32 byte rlp-encoded value will be accessible in 'st.val'.
370-
// - And the 'st.type' will be 'hashedNode' AGAIN
370+
// - Then the <32 byte rlp-encoded value will be accessible in 'st.val'.
371+
// - And the 'st.type' will be 'hashedNode' AGAIN
371372
//
372373
// This method will also:
373374
// set 'st.type' to hashedNode

0 commit comments

Comments
 (0)