Skip to content

Commit c74764c

Browse files
committed
Correct linter issues
1 parent e4d7cfa commit c74764c

26 files changed

+70
-25
lines changed

.golangci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ linters:
1515
- govet
1616
- ineffassign
1717
- misspell
18-
- nakedret
1918
- revive
20-
- structcheck
2119
- unused
2220
- varcheck
2321
- staticcheck
@@ -26,6 +24,6 @@ linters-settings:
2624
gofmt:
2725
simplify: true
2826
goimports:
29-
local-prefixes: helm.sh/helm/v3
27+
local-prefixes: github.com/quickfixgo/quickfix
3028
dupl:
3129
threshold: 400

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
GOBIN = $(shell go env GOBIN)
2+
ifeq ($(GOBIN),)
3+
GOBIN = $(shell go env GOPATH)/bin
4+
endif
5+
GOX = $(GOBIN)/gox
6+
GOIMPORTS = $(GOBIN)/goimports
7+
ARCH = $(shell uname -p)
8+
9+
# ------------------------------------------------------------------------------
10+
# dependencies
11+
12+
# If go install is run from inside the project directory it will add the
13+
# dependencies to the go.mod file. To avoid that we change to a directory
14+
# without a go.mod file when downloading the following dependencies
15+
16+
$(GOX):
17+
(cd /; GO111MODULE=on go install github.com/mitchellh/gox@latest)
18+
19+
$(GOIMPORTS):
20+
(cd /; GO111MODULE=on go install golang.org/x/tools/cmd/goimports@latest)
21+
22+
# ------------------------------------------------------------------------------
23+
124
all: vet test
225

326
clean:
@@ -13,6 +36,10 @@ generate-dist:
1336
test-style:
1437
GO111MODULE=on golangci-lint run
1538

39+
.PHONY: format
40+
format: $(GOIMPORTS)
41+
GO111MODULE=on go list -f '{{.Dir}}' ./... | xargs $(GOIMPORTS) -w -local github.com/quickfixgo/quickfix
42+
1643
fmt:
1744
go fmt `go list ./... | grep -v quickfix/gen`
1845

acceptor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"sync"
1212

1313
proxyproto "github.com/armon/go-proxyproto"
14+
1415
"github.com/quickfixgo/quickfix/config"
1516
)
1617

datadictionary/component_type_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package datadictionary_test
33
import (
44
"testing"
55

6-
"github.com/quickfixgo/quickfix/datadictionary"
76
"github.com/stretchr/testify/assert"
7+
8+
"github.com/quickfixgo/quickfix/datadictionary"
89
)
910

1011
func TestNewComponentType(t *testing.T) {

datadictionary/field_def_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package datadictionary_test
33
import (
44
"testing"
55

6-
"github.com/quickfixgo/quickfix/datadictionary"
76
"github.com/stretchr/testify/assert"
7+
8+
"github.com/quickfixgo/quickfix/datadictionary"
89
)
910

1011
func TestNewFieldDef(t *testing.T) {

datadictionary/field_type_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package datadictionary_test
33
import (
44
"testing"
55

6-
"github.com/quickfixgo/quickfix/datadictionary"
76
"github.com/stretchr/testify/assert"
7+
8+
"github.com/quickfixgo/quickfix/datadictionary"
89
)
910

1011
func TestNewFieldType(t *testing.T) {

datadictionary/group_field_def_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package datadictionary_test
33
import (
44
"testing"
55

6-
"github.com/quickfixgo/quickfix/datadictionary"
76
"github.com/stretchr/testify/assert"
7+
8+
"github.com/quickfixgo/quickfix/datadictionary"
89
)
910

1011
func TestNewGroupField(t *testing.T) {

datadictionary/message_def_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package datadictionary_test
33
import (
44
"testing"
55

6-
"github.com/quickfixgo/quickfix/datadictionary"
76
"github.com/stretchr/testify/assert"
7+
8+
"github.com/quickfixgo/quickfix/datadictionary"
89
)
910

1011
func TestNewMessageDef(t *testing.T) {

dialer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import (
44
"fmt"
55
"net"
66

7-
"github.com/quickfixgo/quickfix/config"
87
"golang.org/x/net/proxy"
8+
9+
"github.com/quickfixgo/quickfix/config"
910
)
1011

1112
func loadDialerConfig(settings *SessionSettings) (dialer proxy.Dialer, err error) {

dialer_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55
"testing"
66
"time"
77

8-
"github.com/quickfixgo/quickfix/config"
98
"github.com/stretchr/testify/suite"
9+
10+
"github.com/quickfixgo/quickfix/config"
1011
)
1112

1213
type DialerTestSuite struct {

0 commit comments

Comments
 (0)