Skip to content

Commit 7fdcf4a

Browse files
Bump golangci/golangci-lint-action from 6.3.2 to 6.5.0 (#83)
* Bump golangci/golangci-lint-action from 6.3.2 to 6.5.0 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.3.2 to 6.5.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@v6.3.2...v6.5.0) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix CI and use Go v1.24 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sergey Vilgelm <sergey@vilgelm.com>
1 parent 7f36979 commit 7fdcf4a

File tree

6 files changed

+61
-48
lines changed

6 files changed

+61
-48
lines changed

.github/workflows/checks.yaml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,49 @@ on:
1010
schedule:
1111
- cron: "0 0 * * 0"
1212

13-
env:
14-
GO: 1.23
15-
16-
jobs:
17-
CodeQL:
18-
runs-on: ubuntu-latest
19-
20-
permissions:
21-
security-events: write
22-
23-
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v4
13+
concurrency:
14+
group: ${{ format('{0}-{1}', github.workflow, github.head_ref) }}
15+
cancel-in-progress: true
2616

27-
- name: Initialize CodeQL
28-
uses: github/codeql-action/init@v3
29-
with:
30-
languages: go
17+
env:
18+
GO: "1.24"
3119

32-
- name: Perform CodeQL Analysis
33-
uses: github/codeql-action/analyze@v3
20+
permissions: read-all
3421

22+
jobs:
3523
UnitTests:
3624
runs-on: ubuntu-latest
3725

3826
steps:
3927
- name: Checkout repository
40-
uses: actions/checkout@v4
28+
uses: actions/checkout@v4.2.2 # immutable action, safe to use a version instead of hashtag
4129

4230
- name: Install Go
43-
uses: actions/setup-go@v5
31+
uses: actions/setup-go@v5.3.0 # immutable action, safe to use a version instead of hashtag
4432
with:
4533
go-version: ${{ env.GO }}
4634

4735
- name: Run Unit Tests
4836
run: go test -race -cover -coverprofile=coverage.out -covermode=atomic
4937

5038
- name: Codecov
51-
uses: codecov/codecov-action@v5.3.1
52-
with:
53-
file: ./coverage.out
39+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
40+
env:
41+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5442

5543
GolangCI-Lint:
5644
runs-on: ubuntu-latest
5745

5846
steps:
5947
- name: Checkout repository
60-
uses: actions/checkout@v4
48+
uses: actions/checkout@v4.2.2 # immutable action, safe to use a version instead of hashtag
6149

6250
- name: Install Go
63-
uses: actions/setup-go@v5
51+
uses: actions/setup-go@v5.3.0 # immutable action, safe to use a version instead of hashtag
6452
with:
6553
go-version: ${{ env.GO }}
6654

6755
- name: Run GolangCi-Lint
68-
uses: golangci/golangci-lint-action@v6.3.2
56+
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
6957
with:
7058
version: latest

.golangci.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,77 @@
1-
run:
2-
skip-dirs-use-default: true
3-
41
linters:
52
enable: # keep in ascending order
3+
- asasalint
64
- asciicheck
75
- bodyclose
6+
- contextcheck
7+
- copyloopvar
88
- dupl
99
- durationcheck
10+
- err113
11+
- errcheck
12+
- errorlint
1013
- exhaustive
11-
- exportloopref
14+
- exptostd
15+
- fatcontext
1216
- gci
17+
- gocheckcompilerdirectives
18+
- gochecksumtype
1319
- gocognit
1420
- goconst
1521
- gocritic
1622
- gocyclo
17-
- goerr113
1823
- gofumpt
1924
- goprintffuncname
2025
- gosec
26+
- gosimple
27+
- govet
28+
- iface
29+
- inamedparam
30+
- ineffassign
31+
- intrange
2132
- lll
33+
- mirror
2234
- misspell
35+
- musttag
2336
- nestif
37+
- nilerr
2438
- noctx
2539
- nolintlint
40+
- perfsprint
2641
- prealloc
2742
- predeclared
43+
- reassign
44+
- recvcheck
45+
- sloglint
46+
- staticcheck
47+
- tagliatelle
48+
- testableexamples
49+
- testifylint
50+
- testpackage
2851
- thelper
52+
- tparallel
2953
- unconvert
3054
- unparam
3155
- unused
56+
- usestdlibvars
57+
- usetesting
58+
- wastedassign
3259
- whitespace
3360

3461
linters-settings:
3562
dupl:
3663
threshold: 100
3764
misspell:
3865
locale: US
39-
golint:
40-
min-confidence: 0
4166
govet:
4267
enable-all: true
4368
disable:
4469
- shadow
4570
gci:
46-
local-prefixes: github.com/sv-tools/conf-reader-env
71+
sections:
72+
- standard
73+
- default
74+
- prefix(github.com/sv-tools/conf-reader-env)
4775
gocognit:
4876
min-complexity: 15
4977
gocyclo:
@@ -56,8 +84,6 @@ linters-settings:
5684
goconst:
5785
min-len: 3
5886
min-occurrences: 3
59-
maligned:
60-
suggest-new: true
6187
prealloc:
6288
for-loops: true
6389
gocritic:

go.mod

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
module github.com/sv-tools/conf-reader-env
22

3-
go 1.23
4-
5-
toolchain go1.23.0
3+
go 1.24.0
64

75
require (
86
github.com/stretchr/testify v1.10.0
9-
github.com/sv-tools/conf v1.3.0
7+
github.com/sv-tools/conf v1.4.0
108
)
119

1210
require (
1311
github.com/davecgh/go-spew v1.1.1 // indirect
1412
github.com/pmezard/go-difflib v1.0.0 // indirect
15-
github.com/spf13/cast v1.7.0 // indirect
13+
github.com/spf13/cast v1.7.1 // indirect
1614
gopkg.in/yaml.v3 v3.0.1 // indirect
1715
)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV
1414
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
1515
github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w=
1616
github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
17+
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
18+
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
1719
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1820
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1921
github.com/sv-tools/conf v1.3.0 h1:efYrEHeHQu5uaeqL7gVu5oP19M9ksckUnbZON4RrGYI=
2022
github.com/sv-tools/conf v1.3.0/go.mod h1:fogkBBqNOnCyvQeU6kZuDw/dMtw4qyOQBJXgh+P47Zo=
23+
github.com/sv-tools/conf v1.4.0 h1:IT/6x899dsSe9mv/oBAKqKpPVpL/0Q1gkSk0iPr2mvY=
24+
github.com/sv-tools/conf v1.4.0/go.mod h1:l4wXlwHUJtPjsgT2KIZVC0LrgleMRiQFD0eMoMb5o9I=
2125
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2226
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2327
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func (r *envReader) Prefix() string {
1616
return r.prefix
1717
}
1818

19-
func (r *envReader) Read(ctx context.Context) (interface{}, error) {
19+
func (r *envReader) Read(ctx context.Context) (any, error) {
2020
res := map[string]string{}
2121
for env, key := range r.mapEnvKey {
2222
if value, ok := os.LookupEnv(env); ok {

reader_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@ import (
1515
const envName = "TEST_FOO"
1616

1717
func TestNew(t *testing.T) {
18-
t.Cleanup(func() {
19-
require.NoError(t, os.Unsetenv(envName))
20-
})
21-
require.NoError(t, os.Setenv(envName, "42"))
18+
t.Setenv(envName, "42")
2219

2320
c := conf.New().WithReaders(confenv.New(map[string]string{envName: "foo"}, ""))
24-
require.NoError(t, c.Load(context.Background()))
21+
require.NoError(t, c.Load(t.Context()))
2522

2623
require.Equal(t, 42, c.GetInt("foo"))
2724
}

0 commit comments

Comments
 (0)