mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Add linter checks to GHA & Fix code to pass lints
Add linter checks to GHA & Fix code to pass lints. The linters added are: - whitespace: Tool for detection of leading and trailing whitespace - gosec: Inspects source code for security problems - gci: Gci control golang package import order and make it always deterministic - misspell: Finds commonly misspelled English words in comments - gomnd: An analyzer to detect magic numbers The file utils/utils.go is excluded from the checks of gomnd, as uses magic numbers through the code
This commit is contained in:
@@ -7,7 +7,9 @@ import (
|
||||
"github.com/hermeznetwork/hermez-node/common"
|
||||
"github.com/hermeznetwork/hermez-node/db"
|
||||
"github.com/jmoiron/sqlx"
|
||||
_ "github.com/lib/pq" // driver for postgres DB
|
||||
|
||||
//nolint:errcheck // driver for postgres DB
|
||||
_ "github.com/lib/pq"
|
||||
migrate "github.com/rubenv/sql-migrate"
|
||||
"github.com/russross/meddler"
|
||||
)
|
||||
|
||||
@@ -49,8 +49,8 @@ func TestBlocks(t *testing.T) {
|
||||
// Generate fake blocks
|
||||
blocks := genBlocks(fromBlock, toBlock)
|
||||
// Insert blocks into DB
|
||||
for _, block := range blocks {
|
||||
err := historyDB.AddBlock(&block)
|
||||
for i := 0; i < len(blocks); i++ {
|
||||
err := historyDB.AddBlock(&blocks[i])
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
// Get all blocks from DB
|
||||
|
||||
Reference in New Issue
Block a user