diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 12c4274979..7cbe26876f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,9 +16,9 @@ jobs: with: go-version: ${{ matrix.go }} - name: Check out source - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 #v3.5.0 - name: Install Linters - run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.1" + run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2" - name: Build run: go build ./... - name: Test diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000000..0897171f05 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,30 @@ +run: + deadline: 10m + +linters: + build-tags: + - rpctest + + disable-all: true + enable: + - asciicheck + - bidichk + - bodyclose + - durationcheck + - errchkjson + - exportloopref + - gofmt + - goimports + - gosimple + - govet + - grouper + - ineffassign + - misspell + - nosprintfhostport + - reassign + - rowserrcheck + - tparallel + - typecheck + - unconvert + - unused + - vetshadow diff --git a/cmd/addblock/import.go b/cmd/addblock/import.go index c73ae64964..a8a051cb13 100644 --- a/cmd/addblock/import.go +++ b/cmd/addblock/import.go @@ -319,7 +319,7 @@ func newBlockImporter(ctx context.Context, db database.DB, utxoDb *leveldb.DB, r MaxSize: 100 * 1024 * 1024, // 100 MiB }) - chain, err := blockchain.New(context.Background(), + chain, err := blockchain.New(ctx, &blockchain.Config{ DB: db, ChainParams: activeNetParams, diff --git a/run_tests.sh b/run_tests.sh index 4d514fcd00..93ad77c2b9 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -39,14 +39,7 @@ for module in $MODPATHS; do cd $MODNAME # run linters - golangci-lint run --build-tags=rpctest --disable-all --deadline=10m \ - --enable=gofmt \ - --enable=gosimple \ - --enable=unconvert \ - --enable=ineffassign \ - --enable=govet \ - --enable=misspell \ - --enable=unused \ + golangci-lint run ) done