Skip to content

Commit 406c915

Browse files
committed
migrate golangci-lint config
1 parent 92b4a19 commit 406c915

File tree

6 files changed

+58
-56
lines changed

6 files changed

+58
-56
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ jobs:
1111
name: lint
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: setup go
15-
uses: actions/setup-go@v5
16-
with:
17-
go-version: 1.19
1814
- uses: actions/checkout@v4
19-
- name: golangci-lint
20-
uses: golangci/golangci-lint-action@v7
15+
- uses: actions/setup-go@v5
16+
with:
17+
go-version-file: "go.mod"
18+
- uses: golangci/golangci-lint-action@v7
2119
with:
2220
version: latest
23-
args: "--config .golintci.yaml"

.github/workflows/test.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@ name: Test
33

44
jobs:
55
test:
6-
strategy:
7-
matrix:
8-
go-version: [1.18, 1.19]
9-
os: [ubuntu-latest, macos-latest, windows-latest]
10-
runs-on: ${{ matrix.os }}
6+
runs-on: ubuntu-latest
117
steps:
12-
- name: setup go
13-
uses: actions/setup-go@v5
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-go@v5
1410
with:
15-
go-version: ${{ matrix.go-version }}
16-
- name: checkout code
17-
uses: actions/checkout@v4
11+
go-version-file: "go.mod"
1812
- name: test
1913
run: go test -v -race ./...

.golangci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
2+
version: "2"
3+
run:
4+
modules-download-mode: readonly
5+
issues-exit-code: 1
6+
tests: true
7+
linters:
8+
enable:
9+
- bodyclose
10+
- contextcheck
11+
- errname
12+
- errorlint
13+
- godot
14+
- misspell
15+
- nilerr
16+
- tparallel
17+
- unparam
18+
- whitespace
19+
exclusions:
20+
generated: lax
21+
presets:
22+
- comments
23+
- common-false-positives
24+
- legacy
25+
- std-error-handling
26+
paths:
27+
- third_party$
28+
- builtin$
29+
- examples$
30+
formatters:
31+
enable:
32+
- gofmt
33+
exclusions:
34+
generated: lax
35+
paths:
36+
- third_party$
37+
- builtin$
38+
- examples$

.golintci.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

go.mod

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
module github.com/jacobbednarz/go-csp-collector
22

3-
go 1.19
3+
go 1.23.0
4+
5+
toolchain go1.23.4
46

57
require (
8+
github.com/davidmytton/url-verifier v1.0.1
69
github.com/gorilla/mux v1.8.1
710
github.com/sirupsen/logrus v1.9.3
811
)
912

1013
require (
1114
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
12-
github.com/davidmytton/url-verifier v1.0.1 // indirect
13-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
15+
github.com/stretchr/testify v1.10.0 // indirect
16+
golang.org/x/sys v0.31.0 // indirect
1417
)

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
1212
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
1313
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
1414
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
15-
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
1615
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
17-
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
18-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
16+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
17+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1918
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19+
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
20+
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
2021
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
21-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
2222
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
23+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
24+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)