Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
[TT-10630] Upgrade Go version to 1.21 (#665)
Browse files Browse the repository at this point in the history
* upgrade go version to 1.21

Signed-off-by: Burak Sekili <[email protected]>

* use copy of the tc in order to prevent running range variables in the func literals

Signed-off-by: Burak Sekili <[email protected]>

* update golangci lint version

Signed-off-by: Burak Sekili <[email protected]>

---------

Signed-off-by: Burak Sekili <[email protected]>
Co-authored-by: Pranshu <[email protected]>
  • Loading branch information
buraksekili and singhpr authored Dec 20, 2023
1 parent e0d6aea commit e51f2ca
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: check out code
uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.50.1
version: v1.55.2

# Optional: golangci-lint command line arguments.
args: --verbose --timeout=5m
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.21.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.21.x

- name: Cache Go Modules
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ linters-settings:
extra-rules: true

# Select the Go version to target.
lang-version: "1.19"
lang-version: "1.21"

lll:
# Max line length; lines longer will be reported
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- Added `tyk` to `categories` field of CRDs. So, from now on, all CRs related to Tyk Operator is grouped
into `tyk` category and can be displayed via `kubectl get tyk`.

**Updated**
- Updated Go version to 1.21

## [v0.15.1](https://github.com/TykTechnologies/tyk-operator/tree/v0.15.1)
[Full Changelog](https://github.com/TykTechnologies/tyk-operator/compare/v0.15.0...v0.15.1)

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.21 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 2 additions & 0 deletions controllers/ingress_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func TestBuildAPIName(t *testing.T) {
}

for n, tc := range tests {
tc := tc

t.Run(n, func(t *testing.T) {
t.Parallel()
result := reconciler.buildAPIName(tc.Namespace, tc.Name, tc.Hash)
Expand Down
2 changes: 2 additions & 0 deletions controllers/operatorcontext_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func TestOperatorContextDelete(t *testing.T) {
}

for n, tc := range tests {
tc := tc

t.Run(n, func(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/TykTechnologies/tyk-operator

go 1.19
go 1.21

require (
github.com/TykTechnologies/graphql-go-tools v1.6.2-0.20221207092329-acdd20d63048
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down

0 comments on commit e51f2ca

Please sign in to comment.