diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..14c7119a9027e95b4fcc2f4e2a2e1c10f39ffcb4 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1 @@ +FROM mcr.microsoft.com/vscode/devcontainers/go:0-1.18 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000000000000000000000000000000..8dd1b30a2a33bca9d33b8348492595537ece7e19 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +{ + "name": "Go & Mongo DB", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspace", + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + "customizations": { + "vscode": { + "settings": { + "go.toolsManagement.checkForUpdates": "local", + "go.useLanguageServer": true, + "go.gopath": "/go" + }, + "extensions": [ + "golang.Go", + "mongodb.mongodb-vscode" + ] + } + }, + "remoteUser": "vscode" +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..deb58bf2afde2c7e0ca67afb747cf03385120ac6 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,39 @@ +version: '3.8' + +services: + app: + build: + context: . + dockerfile: Dockerfile + volumes: + - ..:/workspace:cached + + # Overrides default command so things don't shut down after the process ends. + command: sleep infinity + + # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. + network_mode: service:db + + # Uncomment the next line to use a non-root user for all processes. + # user: node + + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + + db: + image: mongo:latest + restart: unless-stopped + volumes: + - mongodb-data:/data/db + + # Uncomment to change startup options + # environment: + # MONGO_INITDB_ROOT_USERNAME: root + # MONGO_INITDB_ROOT_PASSWORD: example + # MONGO_INITDB_DATABASE: your-database-here + + # Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + +volumes: + mongodb-data: \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9ca3688ac6a4a879aff6cec2ef795b880275add4..7de7c5db22ecbdda87a6b9db005b31616906aeda 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,21 +18,34 @@ jobs: permissions: contents: read # for actions/checkout to fetch code pull-requests: read # for golangci/golangci-lint-action to fetch pull requests - name: lint + name: Linter runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + - name: Checkout source code + uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v2 with: - version: v1.41 + go-version: '1.18' + - name: Install golangci-lint + run: | + curl -sSLO https://github.com/golangci/golangci-lint/releases/download/v$GOLANGCI_LINT_VERSION/golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz + shasum -a 256 golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz | grep "^$GOLANGCI_LINT_SHA256 " > /dev/null + tar -xf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz + sudo mv golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64/golangci-lint /usr/local/bin/golangci-lint + rm -rf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64* + env: + GOLANGCI_LINT_VERSION: '1.46.2' + GOLANGCI_LINT_SHA256: '242cd4f2d6ac0556e315192e8555784d13da5d1874e51304711570769c4f2b9b' + - name: Test style + run: make test-style build: name: build runs-on: ubuntu-latest strategy: matrix: - go: [1.16] + go: [1.18] fix-version: - FIX_TEST= - FIX_TEST=fix40 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000000000000000000000000000000000000..15aa0a7b1d3658a006cbcabe153df02e6ff4e1b3 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,29 @@ +run: + timeout: 10m + skip-dirs: + - gen + - vendor + +linters: + disable-all: true + enable: + - deadcode + - dupl + - gofmt + - goimports + - gosimple + - govet + - ineffassign + - misspell + - revive + - unused + - varcheck + - staticcheck + +linters-settings: + gofmt: + simplify: true + goimports: + local-prefixes: github.com/quickfixgo/quickfix + dupl: + threshold: 400 \ No newline at end of file diff --git a/Makefile b/Makefile index c23203cff9fc64340683ca5aa95e14b83785744f..ece1c82af5f7795ec658adf27b9413ea8ed0d730 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,26 @@ +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif +GOX = $(GOBIN)/gox +GOIMPORTS = $(GOBIN)/goimports +ARCH = $(shell uname -p) + +# ------------------------------------------------------------------------------ +# dependencies + +# If go install is run from inside the project directory it will add the +# dependencies to the go.mod file. To avoid that we change to a directory +# without a go.mod file when downloading the following dependencies + +$(GOX): + (cd /; GO111MODULE=on go install github.com/mitchellh/gox@latest) + +$(GOIMPORTS): + (cd /; GO111MODULE=on go install golang.org/x/tools/cmd/goimports@latest) + +# ------------------------------------------------------------------------------ + all: vet test clean: @@ -10,16 +33,19 @@ generate: clean generate-dist: cd ..; go run quickfix/cmd/generate-fix/generate-fix.go quickfix/spec/*.xml +test-style: + GO111MODULE=on golangci-lint run + +.PHONY: format +format: $(GOIMPORTS) + GO111MODULE=on go list -f '{{.Dir}}' ./... | xargs $(GOIMPORTS) -w -local github.com/quickfixgo/quickfix + fmt: go fmt `go list ./... | grep -v quickfix/gen` vet: go vet `go list ./... | grep -v quickfix/gen` -lint: - go get github.com/golang/lint/golint - golint . - test: MONGODB_TEST_CXN=localhost go test -v -cover . ./datadictionary ./internal diff --git a/acceptor.go b/acceptor.go index b15c86c0bf0842fc447e5dc045569cc4d97306d6..0ce8e87244a8a85369121da7dc2fe0f0be0476ce 100644 --- a/acceptor.go +++ b/acceptor.go @@ -11,6 +11,7 @@ import ( "sync" proxyproto "github.com/armon/go-proxyproto" + "github.com/quickfixgo/quickfix/config" ) @@ -130,7 +131,7 @@ func (a *Acceptor) Stop() { a.sessionGroup.Wait() } -//Get remote IP address for a given session. +// RemoteAddr gets remote IP address for a given session. func (a *Acceptor) RemoteAddr(sessionID SessionID) (net.Addr, bool) { addr, ok := a.sessionAddr.Load(sessionID) if !ok || addr == nil { diff --git a/datadictionary/component_type_test.go b/datadictionary/component_type_test.go index 6de2b345a47269657e7657164cae86fa59e79560..c9774764b6165e3c5561effde467ef91d1d565fc 100644 --- a/datadictionary/component_type_test.go +++ b/datadictionary/component_type_test.go @@ -3,8 +3,9 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" + + "github.com/quickfixgo/quickfix/datadictionary" ) func TestNewComponentType(t *testing.T) { diff --git a/datadictionary/field_def_test.go b/datadictionary/field_def_test.go index 9c0a68abbd7cd7196698b7d72ae9aba84815617c..cb80fa131bc27bd0c0039c5e00150ab481117455 100644 --- a/datadictionary/field_def_test.go +++ b/datadictionary/field_def_test.go @@ -3,8 +3,9 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" + + "github.com/quickfixgo/quickfix/datadictionary" ) func TestNewFieldDef(t *testing.T) { diff --git a/datadictionary/field_type_test.go b/datadictionary/field_type_test.go index 2a4328dff109c45c09a787fbc1128bd6e476a8c2..00c651eefcfa61452844ad944f2ba40f163671ef 100644 --- a/datadictionary/field_type_test.go +++ b/datadictionary/field_type_test.go @@ -3,8 +3,9 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" + + "github.com/quickfixgo/quickfix/datadictionary" ) func TestNewFieldType(t *testing.T) { diff --git a/datadictionary/group_field_def_test.go b/datadictionary/group_field_def_test.go index e1e9632982b1351fdca1bfdbac2fd3f065474c1c..87147ce55cb3c431c598fd4f8ba4a32bc08d53be 100644 --- a/datadictionary/group_field_def_test.go +++ b/datadictionary/group_field_def_test.go @@ -3,8 +3,9 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" + + "github.com/quickfixgo/quickfix/datadictionary" ) func TestNewGroupField(t *testing.T) { diff --git a/datadictionary/message_def_test.go b/datadictionary/message_def_test.go index 666751fed6de14604e3c7c8843113dcf72e84760..73de164524e875c029af1984813721d59ea29f99 100644 --- a/datadictionary/message_def_test.go +++ b/datadictionary/message_def_test.go @@ -3,8 +3,9 @@ package datadictionary_test import ( "testing" - "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" + + "github.com/quickfixgo/quickfix/datadictionary" ) func TestNewMessageDef(t *testing.T) { diff --git a/dialer.go b/dialer.go index 1645076bf8c81ec7bbf4111cccf0c75ddcab8a64..1eb28ad043a7ea2e3347f217a4ee0bd86734d292 100644 --- a/dialer.go +++ b/dialer.go @@ -4,8 +4,9 @@ import ( "fmt" "net" - "github.com/quickfixgo/quickfix/config" "golang.org/x/net/proxy" + + "github.com/quickfixgo/quickfix/config" ) func loadDialerConfig(settings *SessionSettings) (dialer proxy.Dialer, err error) { diff --git a/dialer_test.go b/dialer_test.go index 510c18f048a6ea0bd4e173ff0ba31aa732b9f3cf..47bf79d08e6f6882d824ff810f52234273e793af 100644 --- a/dialer_test.go +++ b/dialer_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/config" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/config" ) type DialerTestSuite struct { diff --git a/go.mod b/go.mod index 8de42b87aa71c9f55cffc09ab491ae53a9c97785..a47647044367ea32840fb16ee05329e5ba2d6007 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,19 @@ module github.com/quickfixgo/quickfix -go 1.15 +go 1.18 require ( github.com/armon/go-proxyproto v0.0.0-20210323213023-7e956b284f0a github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 - github.com/kr/text v0.2.0 // indirect - github.com/mattn/go-sqlite3 v1.14.7 + github.com/mattn/go-sqlite3 v1.14.14 github.com/pkg/errors v0.9.1 github.com/shopspring/decimal v1.3.1 - github.com/stretchr/objx v0.3.0 // indirect - github.com/stretchr/testify v1.7.0 - golang.org/x/net v0.0.0-20220225172249-27dd8689420f + github.com/stretchr/testify v1.8.0 + golang.org/x/net v0.0.0-20220708220712-1185a9018129 + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/objx v0.4.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 4d56b87d5fdc2fc6fe056ade3110c1ee275d99ab..d567c931c49df12402bded9bedb6de6f25713506 100644 --- a/go.sum +++ b/go.sum @@ -12,38 +12,43 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mattn/go-sqlite3 v1.14.7 h1:fxWBnXkxfM6sRiuH3bqJ4CfzZojMOLVc0UTsTglEghA= -github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/mattn/go-sqlite3 v1.14.14 h1:qZgc/Rwetq+MtyE18WhzjokPD93dNqLGNT3QJuLvBGw= +github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/quickfixgo/enum v0.0.0-20210629025633-9afc8539baba h1:ysNRAW5kAhJ76Wo6LMAtbuFq/64s2E5KK00cS/rR/Po= +github.com/quickfixgo/enum v0.0.0-20210629025633-9afc8539baba/go.mod h1:65gdG2/8vr6uOYcjZBObVHMuTEYc5rr/+aKVWTrFIrQ= +github.com/quickfixgo/field v0.0.0-20171007195410-74cea5ec78c7 h1:a/qsvkJNoj1vcSFTzgLqNcwTRuiM1VjchoRjDOIMNyY= +github.com/quickfixgo/field v0.0.0-20171007195410-74cea5ec78c7/go.mod h1:7kiKeQwJLOrwVXqvt2GAnk4vOH0jErrB3qO6SERmq7c= +github.com/quickfixgo/fix40 v0.0.0-20171007200002-cce875b2c2e7 h1:csHnaP2l65lrchDUvpk2LbA7BF23wsl4aqFqGVX8r10= +github.com/quickfixgo/fix40 v0.0.0-20171007200002-cce875b2c2e7/go.mod h1:RC0yl+6EULF8t40eFen3UdouFVdZu1uVwMsk7O/6i5s= +github.com/quickfixgo/fix41 v0.0.0-20171007212429-b272ca343ed2 h1:dofXBfr8IrzTXvHyu0gV9KIgzBzjVyBd5rmxERw50rE= +github.com/quickfixgo/fix41 v0.0.0-20171007212429-b272ca343ed2/go.mod h1:2CARkVxpb7YV3Ib6qRjI2UFzvlIyhP0lx/nN6GDoZ7w= +github.com/quickfixgo/fix42 v0.0.0-20171007212724-86a4567f1c77 h1:mD360ECTwAK4jbOIrqAH2MdJF3RrH5KuboFNdxSmIDM= +github.com/quickfixgo/fix42 v0.0.0-20171007212724-86a4567f1c77/go.mod h1:RyVaOPb/+NasHAt2e5UJ9PjXT+5AeqyKZfNPOB4UspE= +github.com/quickfixgo/fix43 v0.0.0-20171007213001-a7ff4f2a2470 h1:1bkIwYMs5XrjvKouIiqn2Iiw46XKcNTS1as9hCZqnMg= +github.com/quickfixgo/fix43 v0.0.0-20171007213001-a7ff4f2a2470/go.mod h1:qpAUIIjRXEQRtuMpJolR+8VkDajoU8J7Iw55Gnwm15s= +github.com/quickfixgo/fix44 v0.0.0-20171007213039-f090a1006218 h1:zrm7CRhis2ArB/xjOj0EQJOuHq5fI0JpS4AILtjwUug= +github.com/quickfixgo/fix44 v0.0.0-20171007213039-f090a1006218/go.mod h1:KFN4LkI1sidKgWnUvmpDdvsa+aNvcbExtS8iPQvA9ys= +github.com/quickfixgo/fixt11 v0.0.0-20171007213433-d9788ca97f5d h1:PlymcwOkKZXnOI3uJZu0lpnvnweTkML9YxnTuYhhzIM= +github.com/quickfixgo/fixt11 v0.0.0-20171007213433-d9788ca97f5d/go.mod h1:/oN4Arv+/8zKshQTj+ggpWfjXuVv9bMUO93zOO6R+oM= +github.com/quickfixgo/tag v0.0.0-20171007194743-cbb465760521 h1:RXfjXtjvXb4wgzBHTTFbyW5uBP04Nrlky9e9lAe8mIE= +github.com/quickfixgo/tag v0.0.0-20171007194743-cbb465760521/go.mod h1:EKAI2kkSaIuSywW0WbIgXIcuA9vS4IXfCga9U9Oax2E= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As= -github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +golang.org/x/net v0.0.0-20220708220712-1185a9018129 h1:vucSRfWwTsoXro7P+3Cjlr6flUMtzCwzlvkxEQtHHB0= +golang.org/x/net v0.0.0-20220708220712-1185a9018129/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/in_session_test.go b/in_session_test.go index c8c0b1523d92432473522894528cf0e661e513fe..80e827decac65a2c43719701f5bca5d1e13d32a9 100644 --- a/in_session_test.go +++ b/in_session_test.go @@ -4,8 +4,9 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/internal" ) type InSessionTestSuite struct { diff --git a/logon_state_test.go b/logon_state_test.go index 0b933c0a24d32b2d2f68015ec7401a329b28f950..cea45618bb0e551891eb79eefb1985d4cf7ca292 100644 --- a/logon_state_test.go +++ b/logon_state_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/internal" ) type LogonStateTestSuite struct { @@ -82,7 +83,7 @@ func (s *LogonStateTestSuite) TestFixMsgInLogon() { s.MockApp.AssertExpectations(s.T()) s.State(inSession{}) - s.Equal(32*time.Second, s.session.HeartBtInt) //should be written from logon message + s.Equal(32*time.Second, s.session.HeartBtInt) //should be written from logon message s.False(s.session.HeartBtIntOverride) s.LastToAdminMessageSent() diff --git a/logout_state_test.go b/logout_state_test.go index ce1ae84b6abdcfeeb21041fe424556f3c3674f0d..5b074f3296ef4e78135bf41027147526388bc0aa 100644 --- a/logout_state_test.go +++ b/logout_state_test.go @@ -3,8 +3,9 @@ package quickfix import ( "testing" - "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/internal" ) type LogoutStateTestSuite struct { diff --git a/message.go b/message.go index f800cbebf54a6a6af36ca0087d0f6859c503420a..d76e5ca44c18ce9fbda7089b1450c7904805f14b 100644 --- a/message.go +++ b/message.go @@ -114,7 +114,7 @@ func NewMessage() *Message { return m } -// CopyInto erases the dest messages and copies the curreny message content +// CopyInto erases the dest messages and copies the currency message content // into it. func (m *Message) CopyInto(to *Message) { m.Header.CopyInto(&to.Header.FieldMap) diff --git a/message_test.go b/message_test.go index 3766c9221347680dd228fa260dc6f5b212bad5d7..40b063ca10174a0ea280ae365184ceb72ee69dfc 100644 --- a/message_test.go +++ b/message_test.go @@ -5,8 +5,9 @@ import ( "reflect" "testing" - "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/datadictionary" ) func BenchmarkParseMessage(b *testing.B) { diff --git a/mongostore.go b/mongostore.go index e50af2c165db1b201597f87299f3f7d9a2e03b2c..15c419347956f5cc1b69ce0cfe5a3892d40285ba 100644 --- a/mongostore.go +++ b/mongostore.go @@ -7,6 +7,7 @@ import ( "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" "github.com/pkg/errors" + "github.com/quickfixgo/quickfix/config" ) diff --git a/parser.go b/parser.go index e774cffadfb6b2f55484c78f083e74025ad9d654..13b992d03b65a998bc7f99abc5faedc783bb5e34 100644 --- a/parser.go +++ b/parser.go @@ -11,7 +11,6 @@ const ( defaultBufSize = 4096 ) - type parser struct { //buffer is a slice of bigBuffer bigBuffer, buffer []byte diff --git a/pending_timeout_test.go b/pending_timeout_test.go index a9e4bf8f122fe2b8127b974524bd7da62b7fef9c..1ad845d895fa96a458485df4d95fde1758310f89 100644 --- a/pending_timeout_test.go +++ b/pending_timeout_test.go @@ -3,8 +3,9 @@ package quickfix import ( "testing" - "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/internal" ) type PendingTimeoutTestSuite struct { diff --git a/quickfix_test.go b/quickfix_test.go index 2f511b77dc17897e4256d779832fdbc52c0ed590..189aaf21f113e590152028636ab5386ff7a53e42 100644 --- a/quickfix_test.go +++ b/quickfix_test.go @@ -3,10 +3,11 @@ package quickfix import ( "time" - "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/internal" ) type QuickFIXSuite struct { diff --git a/resend_state_test.go b/resend_state_test.go index aa13cc871887e36517517d8244b13f2f920c41ba..4d8184a9d5e04538fd914f9e033179f469f5ecc0 100644 --- a/resend_state_test.go +++ b/resend_state_test.go @@ -3,8 +3,9 @@ package quickfix import ( "testing" - "github.com/quickfixgo/quickfix/internal" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/internal" ) type resendStateTestSuite struct { diff --git a/session_factory_test.go b/session_factory_test.go index c59d81faf58a502de0bc8fa935a13e197fe0d35f..a86cfe369666475f4c20a69c104f7bdad746e01b 100644 --- a/session_factory_test.go +++ b/session_factory_test.go @@ -4,9 +4,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + "github.com/quickfixgo/quickfix/config" "github.com/quickfixgo/quickfix/internal" - "github.com/stretchr/testify/suite" ) type SessionFactorySuite struct { diff --git a/session_id.go b/session_id.go index a261d37897ba58555b2f722dbd33709528be05dd..9ee621c5282e1fa24e10c883b4fbdb24f5c7e73a 100644 --- a/session_id.go +++ b/session_id.go @@ -2,7 +2,7 @@ package quickfix import "bytes" -// SessionID is a unique identifer of a Session +// SessionID is a unique identifier of a Session type SessionID struct { BeginString, TargetCompID, TargetSubID, TargetLocationID, SenderCompID, SenderSubID, SenderLocationID, Qualifier string } diff --git a/settings_test.go b/settings_test.go index b9c219760672d904bc1963a7f4ac4702994f002f..9ce568e5076b28fafa3e3cff096ec2a2a7096ca0 100644 --- a/settings_test.go +++ b/settings_test.go @@ -4,10 +4,11 @@ import ( "strings" "testing" - "github.com/quickfixgo/quickfix/config" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/config" ) func TestSettings_New(t *testing.T) { diff --git a/sqlstore.go b/sqlstore.go index 3569359af37366f2a285c478ad793fe5f96101f0..a57281dd80a3aea73c7fcc8767ac0cfb990950a4 100644 --- a/sqlstore.go +++ b/sqlstore.go @@ -7,6 +7,7 @@ import ( "time" "github.com/pkg/errors" + "github.com/quickfixgo/quickfix/config" ) @@ -35,7 +36,7 @@ func sqlString(raw string, placeholder placeholderFunc) string { idx := 0 return rePlaceholder.ReplaceAllStringFunc(raw, func(s string) string { new := placeholder(idx) - idx += 1 + idx++ return new }) } diff --git a/tls_test.go b/tls_test.go index f1f17dfbb76bcafe55f6b8ab5780b2eb19145ed0..9274b95dd58f016fcd6d7097f27a2510897a716f 100644 --- a/tls_test.go +++ b/tls_test.go @@ -4,8 +4,9 @@ import ( "crypto/tls" "testing" - "github.com/quickfixgo/quickfix/config" "github.com/stretchr/testify/suite" + + "github.com/quickfixgo/quickfix/config" ) type TLSTestSuite struct { diff --git a/validation_test.go b/validation_test.go index c1a49fc6de210de214a8ecd5e21bada251c25d9b..8224c96c01dc7f65563be697c3910b786ec7edb6 100644 --- a/validation_test.go +++ b/validation_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - "github.com/quickfixgo/quickfix/datadictionary" "github.com/stretchr/testify/assert" + + "github.com/quickfixgo/quickfix/datadictionary" ) type validateTest struct {