Skip to content

Commit e4d7cfa

Browse files
committed
Adds dev-container and upgrades go, modifies linter step.
1 parent 1621f19 commit e4d7cfa

File tree

8 files changed

+156
-33
lines changed

8 files changed

+156
-33
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM mcr.microsoft.com/vscode/devcontainers/go:0-1.18

.devcontainer/devcontainer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "Go & Mongo DB",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "app",
5+
"workspaceFolder": "/workspace",
6+
"runArgs": [
7+
"--cap-add=SYS_PTRACE",
8+
"--security-opt",
9+
"seccomp=unconfined"
10+
],
11+
"customizations": {
12+
"vscode": {
13+
"settings": {
14+
"go.toolsManagement.checkForUpdates": "local",
15+
"go.useLanguageServer": true,
16+
"go.gopath": "/go"
17+
},
18+
"extensions": [
19+
"golang.Go",
20+
"mongodb.mongodb-vscode"
21+
]
22+
}
23+
},
24+
"remoteUser": "vscode"
25+
}

.devcontainer/docker-compose.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: '3.8'
2+
3+
services:
4+
app:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
volumes:
9+
- ..:/workspace:cached
10+
11+
# Overrides default command so things don't shut down after the process ends.
12+
command: sleep infinity
13+
14+
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
15+
network_mode: service:db
16+
17+
# Uncomment the next line to use a non-root user for all processes.
18+
# user: node
19+
20+
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
21+
# (Adding the "ports" property to this file will not forward from a Codespace.)
22+
23+
db:
24+
image: mongo:latest
25+
restart: unless-stopped
26+
volumes:
27+
- mongodb-data:/data/db
28+
29+
# Uncomment to change startup options
30+
# environment:
31+
# MONGO_INITDB_ROOT_USERNAME: root
32+
# MONGO_INITDB_ROOT_PASSWORD: example
33+
# MONGO_INITDB_DATABASE: your-database-here
34+
35+
# Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally.
36+
# (Adding the "ports" property to this file will not forward from a Codespace.)
37+
38+
volumes:
39+
mongodb-data:

.github/workflows/ci.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,34 @@ jobs:
1818
permissions:
1919
contents: read # for actions/checkout to fetch code
2020
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
21-
name: lint
21+
name: Linter
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v2
25-
- name: golangci-lint
26-
uses: golangci/golangci-lint-action@v2
24+
- name: Checkout source code
25+
uses: actions/checkout@v2
26+
- name: Setup Go
27+
uses: actions/setup-go@v2
2728
with:
28-
version: v1.41
29+
go-version: '1.18'
30+
- name: Install golangci-lint
31+
run: |
32+
curl -sSLO https://github.com/golangci/golangci-lint/releases/download/v$GOLANGCI_LINT_VERSION/golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz
33+
shasum -a 256 golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz | grep "^$GOLANGCI_LINT_SHA256 " > /dev/null
34+
tar -xf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz
35+
sudo mv golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64/golangci-lint /usr/local/bin/golangci-lint
36+
rm -rf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64*
37+
env:
38+
GOLANGCI_LINT_VERSION: '1.46.2'
39+
GOLANGCI_LINT_SHA256: '242cd4f2d6ac0556e315192e8555784d13da5d1874e51304711570769c4f2b9b'
40+
- name: Test style
41+
run: make test-style
2942

3043
build:
3144
name: build
3245
runs-on: ubuntu-latest
3346
strategy:
3447
matrix:
35-
go: [1.16]
48+
go: [1.18]
3649
fix-version:
3750
- FIX_TEST=
3851
- FIX_TEST=fix40

.golangci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
run:
2+
timeout: 10m
3+
skip-dirs:
4+
- gen
5+
- vendor
6+
7+
linters:
8+
disable-all: true
9+
enable:
10+
- deadcode
11+
- dupl
12+
- gofmt
13+
- goimports
14+
- gosimple
15+
- govet
16+
- ineffassign
17+
- misspell
18+
- nakedret
19+
- revive
20+
- structcheck
21+
- unused
22+
- varcheck
23+
- staticcheck
24+
25+
linters-settings:
26+
gofmt:
27+
simplify: true
28+
goimports:
29+
local-prefixes: helm.sh/helm/v3
30+
dupl:
31+
threshold: 400

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@ generate: clean
1010
generate-dist:
1111
cd ..; go run quickfix/cmd/generate-fix/generate-fix.go quickfix/spec/*.xml
1212

13+
test-style:
14+
GO111MODULE=on golangci-lint run
15+
1316
fmt:
1417
go fmt `go list ./... | grep -v quickfix/gen`
1518

1619
vet:
1720
go vet `go list ./... | grep -v quickfix/gen`
1821

19-
lint:
20-
go get -u golang.org/x/lint/golint
21-
/go/bin/golint .
22-
2322
test:
2423
MONGODB_TEST_CXN=localhost go test -v -cover . ./datadictionary ./internal
2524

go.mod

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
module github.com/quickfixgo/quickfix
22

3-
go 1.15
3+
go 1.18
44

55
require (
66
github.com/armon/go-proxyproto v0.0.0-20210323213023-7e956b284f0a
77
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
8-
github.com/kr/text v0.2.0 // indirect
9-
github.com/mattn/go-sqlite3 v1.14.7
8+
github.com/mattn/go-sqlite3 v1.14.14
109
github.com/pkg/errors v0.9.1
1110
github.com/shopspring/decimal v1.3.1
12-
github.com/stretchr/objx v0.3.0 // indirect
13-
github.com/stretchr/testify v1.7.0
14-
golang.org/x/net v0.0.0-20220225172249-27dd8689420f
11+
github.com/stretchr/testify v1.8.0
12+
golang.org/x/net v0.0.0-20220708220712-1185a9018129
13+
github.com/davecgh/go-spew v1.1.1 // indirect
14+
github.com/kr/text v0.2.0 // indirect
15+
github.com/pmezard/go-difflib v1.0.0 // indirect
16+
github.com/stretchr/objx v0.4.0 // indirect
1517
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
16-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
18+
gopkg.in/yaml.v3 v3.0.1 // indirect
1719
)

go.sum

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,43 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
1212
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
1313
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
1414
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
15-
github.com/mattn/go-sqlite3 v1.14.7 h1:fxWBnXkxfM6sRiuH3bqJ4CfzZojMOLVc0UTsTglEghA=
16-
github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
15+
github.com/mattn/go-sqlite3 v1.14.14 h1:qZgc/Rwetq+MtyE18WhzjokPD93dNqLGNT3QJuLvBGw=
16+
github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
1717
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
1818
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
1919
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2020
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
21+
github.com/quickfixgo/enum v0.0.0-20210629025633-9afc8539baba h1:ysNRAW5kAhJ76Wo6LMAtbuFq/64s2E5KK00cS/rR/Po=
22+
github.com/quickfixgo/enum v0.0.0-20210629025633-9afc8539baba/go.mod h1:65gdG2/8vr6uOYcjZBObVHMuTEYc5rr/+aKVWTrFIrQ=
23+
github.com/quickfixgo/field v0.0.0-20171007195410-74cea5ec78c7 h1:a/qsvkJNoj1vcSFTzgLqNcwTRuiM1VjchoRjDOIMNyY=
24+
github.com/quickfixgo/field v0.0.0-20171007195410-74cea5ec78c7/go.mod h1:7kiKeQwJLOrwVXqvt2GAnk4vOH0jErrB3qO6SERmq7c=
25+
github.com/quickfixgo/fix40 v0.0.0-20171007200002-cce875b2c2e7 h1:csHnaP2l65lrchDUvpk2LbA7BF23wsl4aqFqGVX8r10=
26+
github.com/quickfixgo/fix40 v0.0.0-20171007200002-cce875b2c2e7/go.mod h1:RC0yl+6EULF8t40eFen3UdouFVdZu1uVwMsk7O/6i5s=
27+
github.com/quickfixgo/fix41 v0.0.0-20171007212429-b272ca343ed2 h1:dofXBfr8IrzTXvHyu0gV9KIgzBzjVyBd5rmxERw50rE=
28+
github.com/quickfixgo/fix41 v0.0.0-20171007212429-b272ca343ed2/go.mod h1:2CARkVxpb7YV3Ib6qRjI2UFzvlIyhP0lx/nN6GDoZ7w=
29+
github.com/quickfixgo/fix42 v0.0.0-20171007212724-86a4567f1c77 h1:mD360ECTwAK4jbOIrqAH2MdJF3RrH5KuboFNdxSmIDM=
30+
github.com/quickfixgo/fix42 v0.0.0-20171007212724-86a4567f1c77/go.mod h1:RyVaOPb/+NasHAt2e5UJ9PjXT+5AeqyKZfNPOB4UspE=
31+
github.com/quickfixgo/fix43 v0.0.0-20171007213001-a7ff4f2a2470 h1:1bkIwYMs5XrjvKouIiqn2Iiw46XKcNTS1as9hCZqnMg=
32+
github.com/quickfixgo/fix43 v0.0.0-20171007213001-a7ff4f2a2470/go.mod h1:qpAUIIjRXEQRtuMpJolR+8VkDajoU8J7Iw55Gnwm15s=
33+
github.com/quickfixgo/fix44 v0.0.0-20171007213039-f090a1006218 h1:zrm7CRhis2ArB/xjOj0EQJOuHq5fI0JpS4AILtjwUug=
34+
github.com/quickfixgo/fix44 v0.0.0-20171007213039-f090a1006218/go.mod h1:KFN4LkI1sidKgWnUvmpDdvsa+aNvcbExtS8iPQvA9ys=
35+
github.com/quickfixgo/fixt11 v0.0.0-20171007213433-d9788ca97f5d h1:PlymcwOkKZXnOI3uJZu0lpnvnweTkML9YxnTuYhhzIM=
36+
github.com/quickfixgo/fixt11 v0.0.0-20171007213433-d9788ca97f5d/go.mod h1:/oN4Arv+/8zKshQTj+ggpWfjXuVv9bMUO93zOO6R+oM=
37+
github.com/quickfixgo/tag v0.0.0-20171007194743-cbb465760521 h1:RXfjXtjvXb4wgzBHTTFbyW5uBP04Nrlky9e9lAe8mIE=
38+
github.com/quickfixgo/tag v0.0.0-20171007194743-cbb465760521/go.mod h1:EKAI2kkSaIuSywW0WbIgXIcuA9vS4IXfCga9U9Oax2E=
2139
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
2240
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
2341
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
24-
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
25-
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
26-
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
27-
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
28-
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
29-
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
30-
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
31-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
32-
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
33-
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
34-
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
35-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
42+
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
43+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
44+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
45+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
46+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
47+
golang.org/x/net v0.0.0-20220708220712-1185a9018129 h1:vucSRfWwTsoXro7P+3Cjlr6flUMtzCwzlvkxEQtHHB0=
48+
golang.org/x/net v0.0.0-20220708220712-1185a9018129/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
3649
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3750
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
3851
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
3952
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
40-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
41-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
53+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
54+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)