Skip to content

Commit a1641ea

Browse files
committed
Bump Go to 1.24/1.25
1 parent 168abdd commit a1641ea

File tree

11 files changed

+67
-75
lines changed

11 files changed

+67
-75
lines changed

.github/workflows/push.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
- name: checkout main branch
1414
uses: actions/checkout@v4
1515

16-
- uses: actions/setup-go@v4
16+
- uses: actions/setup-go@v5
1717
with:
18-
go-version: 1.22
18+
go-version: '1.25'
1919

20-
- run: go test -coverprofile=cover.out ./...
20+
- run: go test -v -race -coverprofile=cover.out ./...
2121

2222
- name: checkout covrage branch
2323
uses: actions/checkout@v4

.github/workflows/validate.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,25 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- uses: extractions/setup-just@v2
16-
- run: just lint
15+
- uses: actions/setup-go@v5
16+
with:
17+
go-version: '1.25'
18+
- uses: golangci/golangci-lint-action@v7
19+
with:
20+
version: v2.6.1
1721

1822
test:
1923
name: Unit Tests
2024
runs-on: ubuntu-latest
2125
strategy:
2226
matrix:
23-
go: ["1.21", "1.22"]
27+
go: ["1.24", "1.25"]
2428
steps:
2529
- uses: actions/checkout@v4
26-
- uses: extractions/setup-just@v2
27-
- run: GO_VERSION=${{ matrix.go }} just test
30+
- uses: actions/setup-go@v5
31+
with:
32+
go-version: ${{ matrix.go }}
33+
- run: go test -race ./...
2834

2935
inttest:
3036
name: Integration Tests

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea/
22
confd-basic*.zip
33
out
4+
cover.out
5+
*.test

.golangci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
run:
2+
timeout: 10m0s
3+
4+
linters:
5+
enable:
6+
- errcheck
7+
- errorlint
8+
- gofmt
9+
- goimports
10+
- govet
11+
- ineffassign
12+
- staticcheck
13+
- unused
14+
15+
linters-settings:
16+
errcheck:
17+
check-type-assertions: true
18+
check-blank: true
19+
20+
errorlint:
21+
errorf: true
22+
asserts: true
23+
comparison: true
24+
25+
issues:
26+
exclude-use-default: false

Dockerfile

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
1-
ARG GO_VER=1.20
2-
ARG GOLANGCI_VER=1.51
1+
ARG GO_VER=1.24
32

4-
FROM golang:${GO_VER} as base
5-
WORKDIR /src
6-
COPY go.mod go.sum /src/
7-
RUN --mount=type=cache,target=/go/pkg/mod \
8-
go mod download -x
9-
10-
FROM golangci/golangci-lint:v${GOLANGCI_VER}-alpine AS lint-base
11-
12-
FROM base AS lint
13-
RUN --mount=target=. \
14-
--mount=from=lint-base,src=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
15-
--mount=type=cache,target=/go/pkg/mod \
16-
--mount=type=cache,target=/root/.cache/go-build \
17-
--mount=type=cache,target=/root/.cache/golangci-lint \
18-
golangci-lint run --timeout 10m0s ./...
19-
20-
FROM base as unittest
21-
RUN --mount=target=/src \
22-
--mount=type=cache,target=/go/pkg/mod \
23-
--mount=type=cache,target=/root/.cache/go-build \
24-
mkdir /out && \
25-
go test -v -race -coverprofile=/out/cover.out ./... | tee /out/test.stdout
26-
27-
FROM base AS inttest
3+
FROM golang:${GO_VER} AS inttest
284
RUN apt update && apt install -y \
295
openssh-client \
306
sshpass \
@@ -37,8 +13,4 @@ RUN --mount=target=/src \
3713
go test --tags=inttest -c -o /out/inttest.test
3814
WORKDIR /out
3915
COPY inttest/wait-for-hello.sh .
40-
CMD ./inttest.test -test.v -test.race
41-
42-
43-
FROM scratch AS unittest-coverage
44-
COPY --from=unittest /out /
16+
CMD ./inttest.test -test.v -test.race

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This library is used to create client applications for connecting to network devices via NETCONF.
1010

11-
Like Go itself, only the latest two Go versions are tested and supported (Go 1.24 or Go 1.23).
11+
Like Go itself, only the latest two Go versions are tested and supported (Go 1.24 or Go 1.26).
1212

1313
NOTICE: The API is pretty stable but not finalized yet. So changes may happen before a 1.0 release. Check for API changes when you upgrade.
1414

go.mod

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
module github.com/nemith/netconf
22

3-
go 1.23.0
4-
5-
toolchain go1.24.1
3+
go 1.24.10
64

75
require (
8-
github.com/stretchr/testify v1.11.0
9-
golang.org/x/crypto v0.34.0
6+
github.com/stretchr/testify v1.11.1
7+
golang.org/x/crypto v0.45.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-
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
16-
golang.org/x/sys v0.30.0 // indirect
13+
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39
14+
golang.org/x/sys v0.38.0 // indirect
1715
gopkg.in/yaml.v3 v3.0.1 // indirect
1816
)

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
22
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
33
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
44
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5-
github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8=
6-
github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
7-
golang.org/x/crypto v0.34.0 h1:+/C6tk6rf/+t5DhUketUbD1aNGqiSX3j15Z6xuIDlBA=
8-
golang.org/x/crypto v0.34.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
9-
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ=
10-
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8=
11-
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
12-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
13-
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
14-
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
5+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
6+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
7+
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
8+
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
9+
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39 h1:DHNhtq3sNNzrvduZZIiFyXWOL9IWaDPHqTnLJp+rCBY=
10+
golang.org/x/exp v0.0.0-20251125195548-87e1e737ad39/go.mod h1:46edojNIoXTNOhySWIWdix628clX9ODXwPsQuG6hsK0=
11+
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
12+
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
13+
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
14+
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
1515
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1616
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1717
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

justfile

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,11 @@ pwd := justfile_directory()
55
@list:
66
just --list
77

8-
golangci_version := "1.51"
9-
go_version := env_var_or_default("GO_VERSION", "1.20")
10-
118
test *args:
12-
docker buildx build \
13-
--build-arg GO_VER={{ go_version }} \
14-
--output out/test \
15-
--target unittest-coverage . \
16-
{{ args }}
17-
cat out/test/test.stdout
9+
go test -v -race {{ args }}
1810

1911
lint *args:
20-
@docker buildx build \
21-
--build-arg GO_VER={{ go_version }} \
22-
--build-arg GOLANGCI_VER={{ golangci_version }} \
23-
--target lint . \
24-
{{ args }}
12+
golangci-lint run --timeout 10m0s ./... {{ args }}
2513

2614
inttest:
2715
just inttest/all

ops.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ type LockReq struct {
322322

323323
func (s *Session) Lock(ctx context.Context, target Datastore) error {
324324
req := LockReq{
325-
XMLName: xml.Name{Local: "lock"},
325+
XMLName: xml.Name{Space: "urn:ietf:params:xml:ns:netconf:base:1.0", Local: "lock"},
326326
Target: target,
327327
}
328328

@@ -332,7 +332,7 @@ func (s *Session) Lock(ctx context.Context, target Datastore) error {
332332

333333
func (s *Session) Unlock(ctx context.Context, target Datastore) error {
334334
req := LockReq{
335-
XMLName: xml.Name{Local: "unlock"},
335+
XMLName: xml.Name{Space: "urn:ietf:params:xml:ns:netconf:base:1.0", Local: "unlock"},
336336
Target: target,
337337
}
338338

0 commit comments

Comments
 (0)