Skip to content

Commit 8e2ba9d

Browse files
committed
BUILD/MINOR: bump go version to 1.21
- update golanci-lint as required. - update gitlab and github CI files to only declare the Go version in 2 places: go.mod and .gitlab-ci.yml
1 parent 5ed2686 commit 8e2ba9d

File tree

10 files changed

+23
-14
lines changed

10 files changed

+23
-14
lines changed

.github/workflows/.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v4
1717
with:
18-
go-version: '1.20'
18+
go-version-file: 'go.mod'
1919
- name: Run GoReleaser
2020
uses: goreleaser/goreleaser-action@v4
2121
with:

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212

13-
- name: Set up Go 1.20
13+
- name: Set up Go
1414
uses: actions/setup-go@v4
1515
with:
16-
go-version: '1.20'
16+
go-version-file: 'go.mod'
1717
id: go
1818

1919
- name: Check out code into the Go module directory

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
uses: actions/checkout@v3
1616
- name: Downloading required packages
1717
run: sudo apt-get install bats
18-
- name: Set up Go 1.20
18+
- name: Set up Go
1919
uses: actions/setup-go@v4
2020
with:
21-
go-version: '1.20'
21+
go-version-file: 'go.mod'
2222
- run: make e2e
2323
env:
2424
HAPROXY_VERSION: ${{ matrix.haproxy_version }}

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Go
1414
uses: actions/setup-go@v4
1515
with:
16-
go-version: '1.20'
16+
go-version-file: 'go.mod'
1717
- uses: actions/cache@v3
1818
with:
1919
path: |
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set up Go
3636
uses: actions/setup-go@v4
3737
with:
38-
go-version: '1.20'
38+
go-version-file: 'go.mod'
3939
- uses: actions/cache@v3
4040
with:
4141
path: |

.gitlab-ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ variables:
66
DOCKER_HOST: tcp://docker:2375
77
DOCKER_BASE_IMAGE: $CI_REGISTRY_GO/haproxy-alpine
88
BATS_VERSION: v1.4.1
9+
GO_VERSION: '1.21'
910

1011
diff:
1112
stage: lint
1213
image:
13-
name: $CI_REGISTRY_GO/docker:stable-go1.20
14+
name: $CI_REGISTRY_GO/docker:stable-go$GO_VERSION
1415
entrypoint: [ "" ]
1516
services:
1617
- name: $CI_REGISTRY_GO/docker:20.10.5-dind
@@ -33,7 +34,7 @@ golangci-lint:
3334
paths:
3435
- build
3536
image:
36-
name: $CI_REGISTRY_GO/golang:1.20
37+
name: $CI_REGISTRY_GO/golang:$GO_VERSION
3738
entrypoint: [""]
3839
tags:
3940
- go
@@ -48,7 +49,7 @@ gofumpt:
4849
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
4950
- if: $CI_PIPELINE_SOURCE == 'push'
5051
image:
51-
name: $CI_REGISTRY_GO/golang:1.20
52+
name: $CI_REGISTRY_GO/golang:$GO_VERSION
5253
entrypoint: [""]
5354
tags:
5455
- go
@@ -73,7 +74,7 @@ build:
7374
paths:
7475
- build
7576
image:
76-
name: $CI_REGISTRY_GO/golang:1.20
77+
name: $CI_REGISTRY_GO/golang:$GO_VERSION
7778
entrypoint: [ "" ]
7879
tags:
7980
- go

.golangci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,16 @@ linters:
7171
- forbidigo
7272
- errcheck
7373
- gocritic
74+
- tagalign
75+
- depguard
7476

7577

7678
issues:
79+
exclude:
80+
# bugs of typecheck linter
81+
- "undeclared name: `shellquote`"
82+
- "github.com/kballard/go-shellquote\" imported but not used"
83+
- "github.com/haproxytech/config-parser/v5/types\" imported but not used"
7784
exclude-rules:
7885
- linters:
7986
- staticcheck

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ GIT_MODIFIED=${GIT_MODIFIED1}${GIT_MODIFIED2}
99
SWAGGER_VERSION=${shell curl -s https://raw.githubusercontent.com/haproxytech/client-native/master/Makefile | grep SWAGGER_VERSION -m 1 | awk -F"=" '{print $$2}'}
1010
BUILD_DATE=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
1111
CGO_ENABLED?=0
12-
GOLANGCI_LINT_VERSION=1.51.1
12+
GOLANGCI_LINT_VERSION=1.54.2
1313

1414
all: update clean build
1515

README.md

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

1010
## Building the Data Plane API
1111

12-
In order to build the Data Plane API you need go 1.20 installed on your system with go modules support enabled, and execute the following steps:
12+
In order to build the Data Plane API you need Go installed on your system with go modules support enabled, and execute the following steps:
1313

1414
1\. Clone dataplaneapi repository
1515

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/haproxytech/dataplaneapi
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv
160160
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
161161
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
162162
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
163+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
163164
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
164165
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
165166
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=

0 commit comments

Comments
 (0)