all: fix invalid directive syntax for golangci-lint nolint

This commit is contained in:
wit 2025-11-20 11:41:36 +08:00
parent f4817b7a53
commit 51870495b6
9 changed files with 13 additions and 13 deletions

View file

@ -53,7 +53,7 @@ func TestKeyEncryptDecrypt(t *testing.T) {
t.Errorf("test %d: key address mismatch: have %x, want %x", i, key.Address, address) t.Errorf("test %d: key address mismatch: have %x, want %x", i, key.Address, address)
} }
// Recrypt with a new password and start over // Recrypt with a new password and start over
password += "new data appended" // nolint: gosec password += "new data appended" //nolint:gosec
if keyjson, err = EncryptKey(key, password, veryLightScryptN, veryLightScryptP); err != nil { if keyjson, err = EncryptKey(key, password, veryLightScryptN, veryLightScryptP); err != nil {
t.Errorf("test %d: failed to re-encrypt key %v", i, err) t.Errorf("test %d: failed to re-encrypt key %v", i, err)
} }

View file

@ -33,7 +33,7 @@ func getFreeDiskSpace(path string) (uint64, error) {
// Available blocks * size per block = available space in bytes // Available blocks * size per block = available space in bytes
var bavail = stat.Bavail var bavail = stat.Bavail
// nolint:staticcheck //nolint:staticcheck
if stat.Bavail < 0 { if stat.Bavail < 0 {
// FreeBSD can have a negative number of blocks available // FreeBSD can have a negative number of blocks available
// because of the grace limit. // because of the grace limit.

File diff suppressed because one or more lines are too long

View file

@ -93,12 +93,12 @@ func (env *testEnv) close() {
env.chain.Stop() env.chain.Stop()
} }
// nolint:unused //nolint:unused
func (env *testEnv) setGasTip(gasTip uint64) { func (env *testEnv) setGasTip(gasTip uint64) {
env.pool.SetGasTip(new(big.Int).SetUint64(gasTip)) env.pool.SetGasTip(new(big.Int).SetUint64(gasTip))
} }
// nolint:unused //nolint:unused
func (env *testEnv) makeTx(nonce uint64, gasPrice *big.Int) *types.Transaction { func (env *testEnv) makeTx(nonce uint64, gasPrice *big.Int) *types.Transaction {
if nonce == 0 { if nonce == 0 {
head := env.chain.CurrentHeader() head := env.chain.CurrentHeader()
@ -125,7 +125,7 @@ func (env *testEnv) makeTxs(n int) []*types.Transaction {
return txs return txs
} }
// nolint:unused //nolint:unused
func (env *testEnv) commit() { func (env *testEnv) commit() {
head := env.chain.CurrentBlock() head := env.chain.CurrentBlock()
block := env.chain.GetBlock(head.Hash(), head.Number.Uint64()) block := env.chain.GetBlock(head.Hash(), head.Number.Uint64())

View file

@ -25,7 +25,7 @@ var precomputed = [10][16]byte{
{10, 8, 7, 1, 2, 4, 6, 5, 15, 9, 3, 13, 11, 14, 12, 0}, {10, 8, 7, 1, 2, 4, 6, 5, 15, 9, 3, 13, 11, 14, 12, 0},
} }
// nolint:unused //nolint:unused
func hashBlocksGeneric(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { func hashBlocksGeneric(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) {
var m [16]uint64 var m [16]uint64
c0, c1 := c[0], c[1] c0, c1 := c[0], c[1]

View file

@ -66,7 +66,7 @@ func (g *GoToolchain) goTool(command string, args ...string) *exec.Cmd {
if g.Root == "" { if g.Root == "" {
g.Root = runtime.GOROOT() g.Root = runtime.GOROOT()
} }
tool := exec.Command(filepath.Join(g.Root, "bin", "go"), command) // nolint: gosec tool := exec.Command(filepath.Join(g.Root, "bin", "go"), command) //nolint:gosec
tool.Args = append(tool.Args, args...) tool.Args = append(tool.Args, args...)
tool.Env = append(tool.Env, "GOROOT="+g.Root) tool.Env = append(tool.Env, "GOROOT="+g.Root)

View file

@ -184,7 +184,7 @@ func newStorageIdentQuery(address common.Address, addressHash common.Hash, stora
// the addressHash denotes the address hash of the associated account; // the addressHash denotes the address hash of the associated account;
// the path denotes the path of the node within the trie; // the path denotes the path of the node within the trie;
// //
// nolint:unused //nolint:unused
func newTrienodeIdentQuery(addrHash common.Hash, path []byte) stateIdentQuery { func newTrienodeIdentQuery(addrHash common.Hash, path []byte) stateIdentQuery {
return stateIdentQuery{ return stateIdentQuery{
stateIdent: newTrienodeIdent(addrHash, string(path)), stateIdent: newTrienodeIdent(addrHash, string(path)),

View file

@ -659,7 +659,7 @@ func (r *trienodeHistoryReader) read(owner common.Hash, path string) ([]byte, er
} }
// writeTrienodeHistory persists the trienode history associated with the given diff layer. // writeTrienodeHistory persists the trienode history associated with the given diff layer.
// nolint:unused //nolint:unused
func writeTrienodeHistory(writer ethdb.AncientWriter, dl *diffLayer) error { func writeTrienodeHistory(writer ethdb.AncientWriter, dl *diffLayer) error {
start := time.Now() start := time.Now()
h := newTrienodeHistory(dl.rootHash(), dl.parent.rootHash(), dl.block, dl.nodes.nodeOrigin) h := newTrienodeHistory(dl.rootHash(), dl.parent.rootHash(), dl.block, dl.nodes.nodeOrigin)
@ -686,7 +686,7 @@ func writeTrienodeHistory(writer ethdb.AncientWriter, dl *diffLayer) error {
} }
// readTrienodeMetadata resolves the metadata of the specified trienode history. // readTrienodeMetadata resolves the metadata of the specified trienode history.
// nolint:unused //nolint:unused
func readTrienodeMetadata(reader ethdb.AncientReader, id uint64) (*trienodeMetadata, error) { func readTrienodeMetadata(reader ethdb.AncientReader, id uint64) (*trienodeMetadata, error) {
header, err := rawdb.ReadTrienodeHistoryHeader(reader, id) header, err := rawdb.ReadTrienodeHistoryHeader(reader, id)
if err != nil { if err != nil {

View file

@ -250,7 +250,7 @@ type accountBinaryIterator struct {
// newBinaryAccountIterator creates a simplistic account iterator to step over // newBinaryAccountIterator creates a simplistic account iterator to step over
// all the accounts in a slow, but easily verifiable way. // all the accounts in a slow, but easily verifiable way.
// //
// nolint:all //nolint:all
func (dl *diskLayer) newBinaryAccountIterator(seek common.Hash) AccountIterator { func (dl *diskLayer) newBinaryAccountIterator(seek common.Hash) AccountIterator {
return &accountBinaryIterator{ return &accountBinaryIterator{
binaryIterator: dl.initBinaryAccountIterator(seek), binaryIterator: dl.initBinaryAccountIterator(seek),
@ -317,7 +317,7 @@ type storageBinaryIterator struct {
// newBinaryStorageIterator creates a simplistic account iterator to step over // newBinaryStorageIterator creates a simplistic account iterator to step over
// all the storage slots in a slow, but easily verifiable way. // all the storage slots in a slow, but easily verifiable way.
// //
// nolint:all //nolint:all
func (dl *diskLayer) newBinaryStorageIterator(account common.Hash, seek common.Hash) StorageIterator { func (dl *diskLayer) newBinaryStorageIterator(account common.Hash, seek common.Hash) StorageIterator {
return &storageBinaryIterator{ return &storageBinaryIterator{
binaryIterator: dl.initBinaryStorageIterator(account, seek), binaryIterator: dl.initBinaryStorageIterator(account, seek),