From 5a8af19443359c4c5841e9b898f3f3ab50506303 Mon Sep 17 00:00:00 2001 From: Pierre-Henri Symoneaux Date: Fri, 14 Feb 2025 15:54:05 +0100 Subject: [PATCH] build: update go to 1.24 Signed-off-by: Pierre-Henri Symoneaux --- .github/actions/setup-build-env/action.yaml | 2 +- .github/workflows/build.yaml | 2 +- common/utils/int.go | 7 +++++++ go.mod | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-build-env/action.yaml b/.github/actions/setup-build-env/action.yaml index ebd6c4f..f879793 100644 --- a/.github/actions/setup-build-env/action.yaml +++ b/.github/actions/setup-build-env/action.yaml @@ -7,4 +7,4 @@ runs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.23" + go-version: "1.24" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index da47cd8..03e3b13 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -53,6 +53,6 @@ jobs: # Require: The version of golangci-lint to use. # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. # When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. - version: v1.60 + version: v1.64 # args: --build-tags yubikey args: --timeout 3m diff --git a/common/utils/int.go b/common/utils/int.go index c9bb4e5..b8166bb 100644 --- a/common/utils/int.go +++ b/common/utils/int.go @@ -21,6 +21,13 @@ func ToInt32[N Integer](n N) int32 { return int32(n) } +func ToUint64[N Integer](n N) uint64 { + if n < 0 { + panic("Integer overflow: must not be negative") + } + return uint64(n) +} + // func ToUint32[N Integer](n N) uint32 { // if n < 0 || uint64(n) > math.MaxUint32 { // panic("Integer overflow") diff --git a/go.mod b/go.mod index ba2f0b9..5d41cc5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ovh/okms-cli -go 1.23.0 +go 1.24.0 require ( github.com/go-piv/piv-go/v2 v2.3.0