Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[go] upgrade to 1.23 #283

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
86396d0
build: go.mod upgrade and update to 1.23
fin09pcap Oct 31, 2024
43b97fb
build: update tools/go.mod
fin09pcap Oct 31, 2024
481500c
build: update allowed compilers for 1.23
fin09pcap Oct 31, 2024
d7d4cbb
fix: update golang version to 1.23.2
fin09pcap Oct 31, 2024
70a8fff
chore: fmt
fin09pcap Oct 31, 2024
412c880
chore: generate
fin09pcap Oct 31, 2024
e49d405
chore: fmt
fin09pcap Oct 31, 2024
17609cb
fix: update paseto transformer with required inputs
fin09pcap Oct 31, 2024
851cdd6
fix: disable test:cli
fin09pcap Nov 10, 2024
6221084
build: update .golangci.yml for deprecations
fin09pcap Nov 10, 2024
11604b7
chore: spelling
fin09pcap Nov 10, 2024
0191401
chore: revive for args variable
fin09pcap Nov 17, 2024
16ec05d
chore: revive
fin09pcap Nov 17, 2024
b7bebcd
fix: error check for fernet keygeneration output
fin09pcap Nov 17, 2024
bbcb9f1
fix: rand.Seed deprecated
fin09pcap Nov 17, 2024
07b7aff
build dump golangci-lint v1.62.2
fin09pcap Dec 1, 2024
b674ee7
chore: golangci-lint update
fin09pcap Dec 5, 2024
626fb7f
chore: generate api
fin09pcap Dec 5, 2024
3cf35e7
chore: staticcheck
fin09pcap Dec 5, 2024
3d6329f
chore: golangci-lint revive
fin09pcap Dec 5, 2024
158f3d3
chore: licenser
fin09pcap Dec 5, 2024
a916f49
fix: update celPackageGetSecret with correct type
fin09pcap Dec 5, 2024
a283a90
chore: golangci-lint revive
fin09pcap Dec 5, 2024
94bfd9d
chore: golangci-lint
fin09pcap Dec 5, 2024
b46c31d
build: update for multiarchitecture builds
fin09pcap Dec 5, 2024
71fc66c
test: update failing tests
fin09pcap Dec 5, 2024
5d50ab7
build: udpate release github action workflow
fin09pcap Dec 5, 2024
79aa511
build: udpate go github action workflow
fin09pcap Dec 5, 2024
206cb5d
build: update github action workflow for go 1.23
fin09pcap Dec 5, 2024
d1d013f
test: trigger
fin09pcap Dec 5, 2024
562697e
chore: copyloopvar
fin09pcap Dec 5, 2024
6469314
build: bump versions for github actions
fin09pcap Dec 5, 2024
12b6dab
test: trigger
fin09pcap Dec 5, 2024
bb410a4
build: adjust gotestsum reference
fin09pcap Dec 5, 2024
f627cac
chore: spelling
fin09pcap Dec 5, 2024
1064f74
build: upgrade go.mod
fin09pcap Dec 5, 2024
b645cfe
build: bump containerd/containerd to 1.7.24
fin09pcap Dec 12, 2024
8699086
build: update github.com/containerd/imgcrypt
fin09pcap Dec 12, 2024
b51039f
build: bump github.com/golang-jwt/jwt/v4
fin09pcap Dec 12, 2024
0c42f0d
fix: remove reference to SSL30
fin09pcap Dec 12, 2024
fb15131
build: go module updates
fin09pcap Dec 12, 2024
53d9575
Merge branch 'main' into go123/upgrade
fin09pcap Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: all the setup-go action should be updated to retrieve the go version from the go.mod file so we have a single source of truth and it's easier to maintain

-
name: Build Harp
run: |
Expand Down
61 changes: 30 additions & 31 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,50 +26,49 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
# Check if there any dirty change for go mod tidy
# Check if there are any dirty change for go mod tidy
go-mod:
name: "Check go modules declaration"
runs-on: ubuntu-latest
steps:
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.23
-
name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Check go mod and go.sum
run: |
go mod tidy -v
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum

# Try compile all binaries first
# Try to compile all binaries first
compile-dryrun:
name: "Compile"
strategy:
fail-fast: true
matrix:
go-version:
- "1.19"
- "1.18.10"
- "1.23.2"
runs-on: ubuntu-latest
needs: [golangci-lint, go-mod]
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
-
name: Cache Go modules
uses: actions/cache@v3.0.3
uses: actions/cache@v4.2.0
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand All @@ -90,14 +89,14 @@ jobs:
steps:
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.23
-
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Lint code
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=10m
Expand All @@ -109,15 +108,15 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.23
-
name: Cache Go modules
uses: actions/cache@v3.0.3
uses: actions/cache@v4.2.0
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand All @@ -128,9 +127,9 @@ jobs:
run: go mod download
-
name: Setup gotestsum
uses: autero1/action-gotestsum@v1.0.0
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.7.0
gotestsum_version: 1.12.0
-
name: Run tests
run: gotestsum --format short-verbose ./pkg/...
Expand All @@ -142,12 +141,12 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.23.2
-
name: Cache Go modules
uses: actions/cache@v3.0.3
Expand All @@ -161,9 +160,9 @@ jobs:
run: go mod download
-
name: Setup gotestsum
uses: autero1/action-gotestsum@v1.0.0
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.7.0
gotestsum_version: 1.12.0
-
name: Run tests
run: gotestsum --format short-verbose ./pkg/...
Expand All @@ -175,15 +174,15 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.23.2
-
name: Cache Go modules
uses: actions/cache@v3.0.3
uses: actions/cache@v4.2.0
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand All @@ -194,9 +193,9 @@ jobs:
run: go mod download
-
name: Setup gotestsum
uses: autero1/action-gotestsum@v1.0.0
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.7.0
gotestsum_version: 1.12.0
-
name: Run tests
run: gotestsum --format short-verbose ./pkg/...
9 changes: 4 additions & 5 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ jobs:
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '1.19'
check-latest: true
go-version: '1.23.2'
-
name: Cache Go modules
uses: actions/cache@v3.0.3
uses: actions/cache@v4.2.0
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand All @@ -47,7 +46,7 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
-
name: Install Cosign
uses: sigstore/cosign-installer@v2.3.0
uses: sigstore/cosign-installer@v3.7.0
-
name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v1
Expand Down
36 changes: 17 additions & 19 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
issues:
exclude-files:
- ".*\\.pb\\.go$"
- ".*\\.gen\\.go$"
- ".*\\_gen\\.go$"
- "mock_.*\\.go"
- ".*\\.resolvers\\.go$"

run:
# default concurrency is a available CPU number
concurrency: 4
Expand All @@ -8,13 +16,6 @@ run:
# include test files or not, default is true
tests: false

skip-files:
- ".*\\.pb\\.go$"
- ".*\\.gen\\.go$"
- ".*\\_gen\\.go$"
- "mock_.*\\.go"
- ".*\\.resolvers\\.go$"

# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true
Expand All @@ -37,7 +38,7 @@ run:
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
# default is "colored-line-number"
format: colored-line-number
formats: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true
Expand Down Expand Up @@ -142,7 +143,7 @@ linters-settings:
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*
exclude-functions: fmt:.*,io/ioutil:^Read.*
exhaustive:
# check switch statements in generated files also
check-generated: false
Expand All @@ -151,8 +152,7 @@ linters-settings:
# switch
default-signifies-exhaustive: false
govet:
# report about shadowed variables
check-shadowing: true
shadow: true
goimports:
local: "github.com/elastic"
golint:
Expand All @@ -161,6 +161,9 @@ linters-settings:
simplify: true
gocyclo:
min-complexity: 15
gosec:
excludes:
- G115 # integer overflow conversion
misspell:
locale: US
lll:
Expand All @@ -170,7 +173,8 @@ linters-settings:
# put imports beginning with prefix after 3rd-party packages;
# only support one prefix
# if not set, use goimports.local-prefixes
local-prefixes: github.com/elastic
sections:
- prefix(github.com/elastic)
gocognit:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 20
Expand All @@ -182,11 +186,6 @@ linters-settings:
nestif:
# minimal complexity of if statements to report, 5 by default
min-complexity: 4
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
Expand Down Expand Up @@ -258,7 +257,7 @@ linters:
# - dupl
- errcheck
- errorlint
- exportloopref
- copyloopvar
- exhaustive
- forbidigo
- funlen
Expand All @@ -269,7 +268,6 @@ linters:
- gofmt
- goheader
- goimports
# - gomnd
- goprintffuncname
- gosec
- gosimple
Expand Down
Loading
Loading