Skip to content

Commit 1f986da

Browse files
committed
BUILD/MINOR: go: upgrade go to 1.20
1 parent 6ae4387 commit 1f986da

File tree

12 files changed

+29
-32
lines changed

12 files changed

+29
-32
lines changed

.github/workflows/.goreleaser.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v3
1212
- name: Set up Go
13-
uses: actions/setup-go@v2
13+
uses: actions/setup-go@v4
1414
with:
15-
go-version: 1.19
15+
go-version: 1.20
1616
- name: Run GoReleaser
17-
uses: goreleaser/goreleaser-action@v2
17+
uses: goreleaser/goreleaser-action@v4
1818
with:
1919
distribution: goreleaser
2020
version: latest

.github/workflows/build.yml

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

13-
- name: Set up Go 1.19
14-
uses: actions/setup-go@v1
13+
- name: Set up Go 1.20
14+
uses: actions/setup-go@v4
1515
with:
16-
go-version: 1.19
16+
go-version: 1.20
1717
id: go
1818

1919
- name: Check out code into the Go module directory
20-
uses: actions/checkout@v1
20+
uses: actions/checkout@v3
2121

2222
- name: Get dependencies
2323
run: |

.github/workflows/e2e.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Check out code into the Go module directory
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616
- name: Downloading required packages
1717
run: sudo apt-get install bats
18-
- name: Set up Go 1.19
19-
uses: actions/setup-go@v1
18+
- name: Set up Go 1.20
19+
uses: actions/setup-go@v4
2020
with:
21-
go-version: 1.19
21+
go-version: 1.20
2222
- run: make e2e
2323
env:
2424
HAPROXY_VERSION: ${{ matrix.haproxy_version }}

.github/workflows/lint.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Check out code
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
- name: Set up Go
14-
uses: actions/setup-go@v2
14+
uses: actions/setup-go@v4
1515
with:
16-
go-version: 1.19
17-
- uses: actions/cache@v2
16+
go-version: 1.20
17+
- uses: actions/cache@v3
1818
with:
1919
path: |
2020
~/.cache/go-build
@@ -31,12 +31,12 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- name: Check out code into the Go module directory
34-
uses: actions/checkout@v2
34+
uses: actions/checkout@v3
3535
- name: Set up Go
36-
uses: actions/setup-go@v2
36+
uses: actions/setup-go@v4
3737
with:
38-
go-version: 1.19
39-
- uses: actions/cache@v2
38+
go-version: 1.20
39+
- uses: actions/cache@v3
4040
with:
4141
path: |
4242
~/.cache/go-build

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ variables:
1010
diff:
1111
stage: lint
1212
image:
13-
name: $CI_REGISTRY_GO/docker:stable-go1.19
13+
name: $CI_REGISTRY_GO/docker:stable-go1.20
1414
entrypoint: [ "" ]
1515
services:
1616
- name: $CI_REGISTRY_GO/docker:20.10.5-dind
@@ -33,7 +33,7 @@ golangci-lint:
3333
paths:
3434
- build
3535
image:
36-
name: $CI_REGISTRY_GO/golang:1.19
36+
name: $CI_REGISTRY_GO/golang:1.20
3737
entrypoint: [""]
3838
tags:
3939
- go
@@ -48,7 +48,7 @@ gofumpt:
4848
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
4949
- if: $CI_PIPELINE_SOURCE == 'push'
5050
image:
51-
name: $CI_REGISTRY_GO/golang:1.19
51+
name: $CI_REGISTRY_GO/golang:1.20
5252
entrypoint: [""]
5353
tags:
5454
- go
@@ -73,7 +73,7 @@ build:
7373
paths:
7474
- build
7575
image:
76-
name: $CI_REGISTRY_GO/golang:1.19
76+
name: $CI_REGISTRY_GO/golang:1.20
7777
entrypoint: [ "" ]
7878
tags:
7979
- go

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.50.1
12+
GOLANGCI_LINT_VERSION=1.51.1
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.19 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 1.20 installed on your system with go modules support enabled, and execute the following steps:
1313

1414
1\. Clone dataplaneapi repository
1515

configuration/configuration.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ import (
2020
"errors"
2121
"fmt"
2222
"io/fs"
23-
"math/rand"
2423
"os"
2524
"path/filepath"
2625
"strings"
2726
"sync"
28-
"time"
2927

3028
petname "github.com/dustinkirkland/golang-petname"
3129
"github.com/haproxytech/client-native/v4/models"
@@ -242,7 +240,6 @@ func (c *Configuration) Load() error {
242240
hostname, nameErr := os.Hostname()
243241
if nameErr != nil {
244242
log.Warningf("Error fetching hostname, using petname for dataplaneapi name: %s", nameErr.Error())
245-
rand.Seed(time.Now().UnixNano())
246243
c.Name.Store(petname.Generate(2, "_"))
247244
}
248245
c.Name.Store(hostname)

configuration/map_sync.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ func equalSomeEntries(fEntries, rEntries models.MapEntries, index ...int) bool {
145145
}
146146

147147
for i := 0; i < maxRandom; i++ {
148-
rand.Seed(time.Now().UTC().UnixNano())
149148
// There's no need for strong number generation, here, just need for performance
150149
r := rand.Intn(max)
151150
if len(index) > 0 {

configure_data_plane.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import (
6565
_ "github.com/GehirnInc/crypt/sha512_crypt"
6666
)
6767

68-
// go:generate swagger generate server --target ../../../../../../github.com/haproxytech --name controller --spec ../../../../../../../../haproxy-api/haproxy-open-api-spec/build/haproxy_spec.yaml --server-package controller --tags Stats --tags Information --tags Configuration --tags Discovery --tags Frontend --tags Backend --tags Bind --tags Server --tags TCPRequestRule --tags HTTPRequestRule --tags HTTPResponseRule --tags Acl --tags BackendSwitchingRule --tags ServerSwitchingRule --tags TCPResponseRule --skip-models --exclude-main
68+
//go:generate swagger generate server --target ../../../../../../github.com/haproxytech --name controller --spec ../../../../../../../../haproxy-api/haproxy-open-api-spec/build/haproxy_spec.yaml --server-package controller --tags Stats --tags Information --tags Configuration --tags Discovery --tags Frontend --tags Backend --tags Bind --tags Server --tags TCPRequestRule --tags HTTPRequestRule --tags HTTPResponseRule --tags Acl --tags BackendSwitchingRule --tags ServerSwitchingRule --tags TCPResponseRule --skip-models --exclude-main
6969

7070
var (
7171
Version string

0 commit comments

Comments
 (0)