Skip to content

Commit

Permalink
Merge pull request #268 from multiversx/fix-linter-in-tests
Browse files Browse the repository at this point in the history
Fixed linter issues in tests
  • Loading branch information
iulianpascalau authored Oct 24, 2023
2 parents 5bdc450 + 1a5c79a commit e7c4fba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
test:
@echo " > Running unit tests"
go test -cover -race -coverprofile=coverage.txt -covermode=atomic -v ./...

lint-install:
ifeq (,$(wildcard test -f bin/golangci-lint))
@echo "Installing golint"
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s
endif

run-lint:
@echo "Running golint"
bin/golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 --timeout=2m

lint: lint-install run-lint
3 changes: 1 addition & 2 deletions data/outport/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ func TestGetBody(t *testing.T) {
require.Nil(t, receivedBody)
require.Equal(t, errNilBodyHandler, err)

var body data.BodyHandler
body = &block.Body{}
var body data.BodyHandler = &block.Body{}
receivedBody, err = GetBody(body)
require.Nil(t, err)
require.Equal(t, body, receivedBody)
Expand Down
3 changes: 1 addition & 2 deletions data/transaction/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,7 @@ func TestTransaction_CheckIntegrityShouldErr(t *testing.T) {
func TestTransaction_ImplementsGuardedTransactionHandler(t *testing.T) {
t.Parallel()

var tx data.TransactionHandler
tx = &transaction.Transaction{}
var tx data.TransactionHandler = &transaction.Transaction{}

_, ok := tx.(data.GuardedTransactionHandler)
assert.True(t, ok)
Expand Down

0 comments on commit e7c4fba

Please sign in to comment.