Skip to content

Commit

Permalink
build with go1.23 (#818)
Browse files Browse the repository at this point in the history
* build with go1.23
* docker build with go1.23.1
* fix linter
* ci: update golangci-lint to v1.61.0
* ci: add go1.23
* update deps
  • Loading branch information
dmachard authored Sep 21, 2024
1 parent 9d24e41 commit 1424dd5
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bench-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os-version: ['ubuntu-22.04' ]
go-version: [ '1.21', '1.22' ]
go-version: [ '1.21', '1.22', '1.23' ]
runs-on: ${{ matrix.os-version }}

steps:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

strategy:
matrix:
go-version: ['1.21', '1.22']
go-version: ['1.21', '1.22', '1.23']

steps:
- uses: actions/checkout@v4
Expand All @@ -46,7 +46,7 @@ jobs:

strategy:
matrix:
go-version: ['1.21', '1.22']
go-version: ['1.21', '1.22', '1.23']

steps:
- uses: actions/checkout@v4
Expand All @@ -65,7 +65,7 @@ jobs:

strategy:
matrix:
go-version: ['1.21', '1.22']
go-version: ['1.21', '1.22', '1.23']

steps:
- uses: actions/checkout@v4
Expand All @@ -85,7 +85,7 @@ jobs:

strategy:
matrix:
go-version: ['1.21', '1.22']
go-version: ['1.21', '1.22', '1.23']

steps:
- uses: actions/checkout@v4
Expand All @@ -104,7 +104,7 @@ jobs:

strategy:
matrix:
go-version: ['1.21', '1.22']
go-version: ['1.21', '1.22', '1.23']

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
# workaround: when the files to be extracted are already present,
# tar extraction in Golangci Lint fails with the "File exists"
# https://github.com/golangci/golangci-lint-action/issues/807
Expand All @@ -38,6 +38,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: "v1.57.1"
version: "v1.61.0"
args: --timeout 3m --verbose

2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/testing-dnstap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.22' ]
go-version: [ '1.23' ]
unbound: [ '1.19.3', '1.20.0' ]

mode: [ 'tcp' ]
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.22' ]
go-version: [ '1.23' ]
coredns: [ '1.10.1', '1.11.1' ]
mode: [ 'tcp' ]

Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.22' ]
go-version: [ '1.23' ]
coredns: [ '1.11.1' ]
mode: [ 'tls' ]

Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.22' ]
go-version: [ '1.23' ]
dnsdist: [ '17', '18', '19' ]

mode: [ 'dnstaptcp', 'dnstapunix' ]
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.22' ]
go-version: [ '1.23' ]
dnsdist: [ '19' ]

steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/testing-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os-version: ['ubuntu-22.04' ] #, 'macos-latest'
go-version: [ '1.21', '1.22' ]
go-version: [ '1.21', '1.22', '1.23' ]
package:
- '.'
- 'pkgconfig'
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.21', '1.22' ]
go-version: [ '1.21', '1.22', '1.23' ]
package: ['config', 'clientquery_dnstaptcp', 'clientquery_dnstapunix' ]

steps:
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.21', '1.22' ]
go-version: [ '1.21', '1.22', '1.23']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- id: count_tests
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testing-powerdns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.22' ]
go-version: [ '1.23' ]
dnsdist: [ '18', '19' ]

steps:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.22' ]
go-version: [ '1.23' ]
recursor: [ '49', '50' ]

steps:
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:

strategy:
matrix:
go-version: [ '1.22' ]
go-version: [ '1.23' ]
recursor: [ '51' ]

steps:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.6-alpine3.19 as builder
FROM golang:1.23.1-alpine3.19 as builder

ARG VERSION

Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ BINARY_NAME := go-dnscollector

GO_VERSION := $(shell go env GOVERSION | sed -n 's/go\([0-9]\+\.[0-9]\+\).*/\1/p')

GO_LOGGER := 1.0.0
GO_POWERDNS_PROTOBUF := 1.1.1
GO_DNSTAP_PROTOBUF := 1.0.2
GO_FRAMESTREAM := 0.10.0
GO_CLIENTSYSLOG := 0.4.0
GO_TOPMAP := 1.0.0
GO_NETUTILS := 0.4.0
GO_LOGGER := 1.1.0
GO_POWERDNS_PROTOBUF := 1.2.0
GO_DNSTAP_PROTOBUF := 1.1.0
GO_FRAMESTREAM := 1.0.0
GO_CLIENTSYSLOG := 1.0.0
GO_TOPMAP := 1.0.1
GO_NETUTILS := 1.0.0

BUILD_TIME := $(shell LANG=en_US date +"%F_%T_%z")
COMMIT := $(shell git rev-parse --short HEAD)
Expand Down
24 changes: 11 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
module github.com/dmachard/go-dnscollector

go 1.22

toolchain go1.22.1
go 1.23

require (
github.com/IBM/fluent-forward-go v0.2.2
github.com/IBM/sarama v1.43.3
github.com/cilium/ebpf v0.16.0
github.com/creasty/defaults v1.8.0
github.com/dmachard/go-clientsyslog v0.4.0
github.com/dmachard/go-dnstap-protobuf v1.0.2
github.com/dmachard/go-framestream v0.10.0
github.com/dmachard/go-logger v1.0.0
github.com/dmachard/go-netutils v0.4.0
github.com/dmachard/go-powerdns-protobuf v1.1.1
github.com/dmachard/go-topmap v1.0.0
github.com/dmachard/go-clientsyslog v1.0.0
github.com/dmachard/go-dnstap-protobuf v1.1.0
github.com/dmachard/go-framestream v1.0.0
github.com/dmachard/go-logger v1.1.0
github.com/dmachard/go-netutils v1.0.0
github.com/dmachard/go-powerdns-protobuf v1.2.0
github.com/dmachard/go-topmap v1.0.1
github.com/farsightsec/golang-framestream v0.3.0
github.com/flosch/pongo2/v6 v6.0.0
github.com/fsnotify/fsnotify v1.7.0
Expand All @@ -37,7 +35,7 @@ require (
github.com/segmentio/kafka-go v0.4.47
github.com/stretchr/testify v1.9.0
github.com/tinylib/msgp v1.2.1
golang.org/x/net v0.28.0
golang.org/x/net v0.29.0
golang.org/x/sys v0.25.0
google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -150,7 +148,7 @@ require (
go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect
go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
Expand All @@ -172,7 +170,7 @@ require (
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prometheus/prometheus v0.54.1
golang.org/x/mod v0.19.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/grpc v1.65.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
Expand Down
40 changes: 20 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,20 @@ github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgz
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/dmachard/go-clientsyslog v0.4.0 h1:1eL/XIzfRCB9g2kVsY4bHAQE7uPVPv472qtXvzU6u6Y=
github.com/dmachard/go-clientsyslog v0.4.0/go.mod h1:llRfIIzxlTNsEQbVF6GKUzxORDWTiSvld3ElJcUtyCo=
github.com/dmachard/go-dnstap-protobuf v1.0.2 h1:LW7+Pwm3tje/1tMV3IRq09OFOr4vN0BQTuKWayznwdQ=
github.com/dmachard/go-dnstap-protobuf v1.0.2/go.mod h1:s4X0YYkv6/Tc9RGmz6hF5dxG3yhE/DtMFC4NLmu8ZoY=
github.com/dmachard/go-framestream v0.10.0 h1:NzDOkpJOdrgV/c0XKCsVxijILbdTxsUcUlSwp4y34mw=
github.com/dmachard/go-framestream v0.10.0/go.mod h1:CiSK1RmU/7hVsM/NhsroqpBxDH3meawKIXR8x8O+LP4=
github.com/dmachard/go-logger v1.0.0 h1:M0z3RDh932uUgvAOSCfLgKbQbrw+3T0SrM4kaM2uhzY=
github.com/dmachard/go-logger v1.0.0/go.mod h1:Gf6Au3CX5l3rZ+Tb3yX31u6h4lwVeZQSBklUI3h8gCA=
github.com/dmachard/go-netutils v0.4.0 h1:u28T4N1sfni0IHC6sqgYIMW8ExtBG8SsYHW7+32gfvE=
github.com/dmachard/go-netutils v0.4.0/go.mod h1:KgAYMuJcF+1Xwtm0SlpJ4S7jBvkFghj+7tFesaHv3BY=
github.com/dmachard/go-powerdns-protobuf v1.1.1 h1:HhgkjPGJN9QCLVFWxiTIwP3E0He8ET9uJZaT7/+6HXw=
github.com/dmachard/go-powerdns-protobuf v1.1.1/go.mod h1:3sewpdCN4u5KpXBxrLpidHAC18v24y+f4OZ4GKfLaME=
github.com/dmachard/go-topmap v1.0.0 h1:FzCnB80WJMSPhpEfWt/79y97XotTQjhlrsXKR6435ow=
github.com/dmachard/go-topmap v1.0.0/go.mod h1:v+v595j5h02u2Vf9OOr6StGBCX2i6qMTEy8n0dbArEA=
github.com/dmachard/go-clientsyslog v1.0.0 h1:wtSH2oI8+uEICNL4II4bjf25sxnGIrOfUgU+PygrnWc=
github.com/dmachard/go-clientsyslog v1.0.0/go.mod h1:X64U7aJpeZNfA94xJU3aRC4RauQhKiTZgrZiRcPeZFc=
github.com/dmachard/go-dnstap-protobuf v1.1.0 h1:66f2FwEQPWHOrypYAcp6/htVwSKIIQ1Ht577Dg1zrE8=
github.com/dmachard/go-dnstap-protobuf v1.1.0/go.mod h1:7HFKxCpWdz/8uZYHVJJYESJ7uAJ58+KNOTb3KU2Ez6k=
github.com/dmachard/go-framestream v1.0.0 h1:cdL8Gc2PhWl9hKXmtBIDIfssplUAsIK3DhfItnsPYgw=
github.com/dmachard/go-framestream v1.0.0/go.mod h1:icl91cC7AE1jw2gXBa/P9iIGmhApfB2EnmZCb4XzoRw=
github.com/dmachard/go-logger v1.1.0 h1:AOXHDEOp4SiXt9ZfVL1jTQNWFTBaw28bR4JfH3/OX/4=
github.com/dmachard/go-logger v1.1.0/go.mod h1:p+qf9XDiJOcpjx1Bl3vRGTVqwLoZ6cNUZCxulaVJ6e8=
github.com/dmachard/go-netutils v1.0.0 h1:WUb4wIJ2r9UJMLXdRvAzZkrS4jMQKTtNa85RkUPx8Gc=
github.com/dmachard/go-netutils v1.0.0/go.mod h1:kTrO5B/mXW/cPdHyUWsHqXUVkvb2mTUwm/68Fc48XuE=
github.com/dmachard/go-powerdns-protobuf v1.2.0 h1:VrmT7Ir2eKvB2I0bTJwlHHPLrS95B3X2gD2tlXEx76A=
github.com/dmachard/go-powerdns-protobuf v1.2.0/go.mod h1:TgY5tdhMyzDkWK0jBtGPDpOFOGp/brrlb5FaW7YgcDM=
github.com/dmachard/go-topmap v1.0.1 h1:aqAul7Nf30fZQjdx5HSCNd0eN8icGAYe5Gqpnp+QKfE=
github.com/dmachard/go-topmap v1.0.1/go.mod h1:oFdFcYhuWBbHEgreYcJrBmUZpTZbZiV5hBK2MvpFD6g=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
Expand Down Expand Up @@ -601,8 +601,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -656,8 +656,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -738,8 +738,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
2 changes: 1 addition & 1 deletion pkginit/pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func InitPipelines(mapLoggers map[string]workers.Worker, mapCollectors map[strin
for _, stanza := range config.Pipelines {
if mapCollectors[stanza.Name] != nil || mapLoggers[stanza.Name] != nil {
if err := CreateRouting(stanza, mapCollectors, mapLoggers, logger); err != nil {
return errors.Errorf(err.Error())
return errors.Wrap(err, "routing")
}
} else {
return errors.Errorf("routing - stanza=[%v] doest not exist", stanza.Name)
Expand Down

0 comments on commit 1424dd5

Please sign in to comment.