From e24fe8a95370ebfcb5cc7287f4a8beb63b263ee9 Mon Sep 17 00:00:00 2001 From: Julien Schmidt Date: Thu, 12 Feb 2026 22:59:02 +0100 Subject: [PATCH 1/2] feat: increase minimum Go version to v1.24 --- .github/workflows/ci.yaml | 4 ++-- go.mod | 6 ++---- go.sum | 18 ++++++++---------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b5e1cdd..fd3c5f4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ on: - main env: - GOLANGCI_LINT_VERSION: v2.5.0 + GOLANGCI_LINT_VERSION: v2.9.0 permissions: contents: read @@ -19,7 +19,7 @@ jobs: name: Test strategy: matrix: - version: ["1.23", "1.24", "1.25"] + version: ["1.24", "1.25", "1.26"] runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/go.mod b/go.mod index 2a56613..425219f 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,8 @@ module github.com/sumup/typeid -go 1.23.0 +go 1.24.0 require ( github.com/gofrs/uuid/v5 v5.4.0 - github.com/jackc/pgx/v5 v5.7.6 + github.com/jackc/pgx/v5 v5.8.0 ) - -require github.com/stretchr/testify v1.8.4 // indirect diff --git a/go.sum b/go.sum index 218ada8..034028c 100644 --- a/go.sum +++ b/go.sum @@ -6,19 +6,17 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.7.6 h1:rWQc5FwZSPX58r1OQmkuaNicxdmExaEz5A2DO2hUuTk= -github.com/jackc/pgx/v5 v5.7.6/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M= +github.com/jackc/pgx/v5 v5.8.0 h1:TYPDoleBBme0xGSAX3/+NujXXtpZn9HBONkQC7IEZSo= +github.com/jackc/pgx/v5 v5.8.0/go.mod h1:QVeDInX2m9VyzvNeiCJVjCkNFqzsNb43204HshNSZKw= github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= -golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= +golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From ad71bac47f37b7085fb92d0306f4bf97df9e2d86 Mon Sep 17 00:00:00 2001 From: Julien Schmidt Date: Thu, 12 Feb 2026 23:09:23 +0100 Subject: [PATCH 2/2] Suppress gosec G602 false positive --- base32/base32.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/base32/base32.go b/base32/base32.go index fcc249d..ce2a115 100644 --- a/base32/base32.go +++ b/base32/base32.go @@ -167,6 +167,8 @@ func DecodeLower(s string) ([]byte, error) { // ensure the table is valid. // // Direct usage is discouraged. Use DecodeUpper or DecodeLower instead. +// +//nolint:gosec // G602 false positive: s length is validated and all indexes are fixed in this unrolled decoder. func Decode(s string, idxTable [256]byte) ([]byte, error) { if len(s) != 26 { return nil, ErrInvalidLength @@ -203,7 +205,7 @@ func Decode(s string, idxTable [256]byte) ([]byte, error) { return nil, ErrInvalidChar } - res := make([]byte, 16) + var res [16]byte res[0] = (idxTable[val[0]] << 5) | idxTable[val[1]] res[1] = (idxTable[val[2]] << 3) | (idxTable[val[3]] >> 2) @@ -222,5 +224,5 @@ func Decode(s string, idxTable [256]byte) ([]byte, error) { res[14] = (idxTable[val[22]] << 7) | (idxTable[val[23]] << 2) | (idxTable[val[24]] >> 3) res[15] = (idxTable[val[24]] << 5) | idxTable[val[25]] - return res, nil + return res[:], nil }