Skip to content

Update Go version to 1.25.5#448

Draft
fin09pcap wants to merge 10 commits intoelastic:mainfrom
fin09pcap:harp/go125-update
Draft

Update Go version to 1.25.5#448
fin09pcap wants to merge 10 commits intoelastic:mainfrom
fin09pcap:harp/go125-update

Conversation

@fin09pcap
Copy link
Member

Overview

The PR includes the following updates and changes to update the project to Go 1.25.5.

Go 1.25.5 Update

  • Updated go.mod files to Go 1.25.5
  • Fixed Go 1.25 compatibility issues:
    • Replaced deprecated runtime.GOROOT() with go env GOROOT command
    • Fixed ECDSA P-384 key handling (compute public key from private scalar)
    • Fixed P-384 key padding to 48-byte fixed size
  • Updated Docker golang image to 1.25.5
  • Updated major dependencies:
    • github.com/hashicorp/consul/api v1.33.0
    • github.com/open-policy-agent/opa v1.9.0
    • go.etcd.io/etcd/client/v3 v3.6.5
    • google.golang.org/grpc v1.76.0
    • Various golang.org/x/* packages

golangci-lint v2 Migration

  • Updated golangci-lint from v1.64.8 to v2.8.0
  • Migrated .golangci.yml to v2 configuration format
  • Updated depguard rules for v2 prefix matching
  • Removed deprecated linters (gofmt, goimports, gosimple, stylecheck)
  • Fixed 79 lint issues (errcheck, gocritic, gosec, revive, staticcheck)

Other Changes

  • Regenerated protobuf and mock files
  • Added ISC license to whitelist (required by OPA v1.9.0 dependency)
  • Added tools.Env to magefile for automatic PATH setup
  • Removed obsolete interfacer nolint directives

Test Plan

  • mage code:lint passes (0 issues)
  • mage test:unit passes (1183 tests)
  • ci github actions tests
  • Manual testing of harp CLI commands

- Update go.mod to Go 1.25.5
- Update samples/bundle-remapper/go.mod to Go 1.25.5
- Update build/mage/docker/const.go golang image to 1.25.5
- Update build/mage/golang/init.go version constraint to ~1.25
- Update dependencies including:
  - github.com/hashicorp/consul/api v1.33.0
  - github.com/awnumar/memguard v0.23.0
  - golang.org/x/term v0.36.0
  - golang.org/x/sys v0.37.0
  - golang.org/x/crypto v0.43.0
  - golang.org/x/oauth2 v0.32.0
  - golang.org/x/sync v0.17.0
  - google.golang.org/grpc v1.76.0
  - github.com/open-policy-agent/opa v1.9.0
  - go.etcd.io/etcd/client/v3 v3.6.5

Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
- pkg/sdk/cmdutil/bug.go: Replace deprecated runtime.GOROOT() with
  `go env GOROOT` command (deprecated since Go 1.24)
- pkg/container/identity/key/json.go: Fix ECDSA P-384 signing by
  computing public key (X,Y) from private scalar. Go 1.24+ requires
  the full key to be initialized before signing.
- pkg/container/identity/key/generator.go: Pad P-384 key components
  to fixed 48-byte size. big.Int.Bytes() strips leading zeros which
  caused "invalid private key size" errors.

Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
Regenerated with:
- protoc-gen-go v1.36.5
- protoc v33.3

Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
Regenerated with mockgen for Go 1.25.5 compatibility.

Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
Add ISC (Internet Systems Consortium) license to approved licenses.
Required by github.com/decred/dcrd/dcrec/secp256k1/v4
(transitive dependency from OPA v1.9.0 update).

Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
- Update golangci-lint from v1.64.8 to v2.8.0
- Migrate .golangci.yml to v2 configuration format
- Update tools/tools.go import paths for v2
- Remove deprecated linters (gofmt, goimports, gosimple, stylecheck)
- Update depguard rules for v2 prefix matching

Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
- Fix errcheck issues by explicitly ignoring fmt.Fprint* return values
- Fix gocritic issue (bytes.Repeat -> make)
- Add nolint:gosec directives for intentional file/subprocess operations
- Configure revive to disable strict exported comment rules
- Configure staticcheck to disable style suggestions (QF*, ST*)
- Remove unused nolint:revive directives
- Update directory permissions from 0755/0744 to 0750 (G301)

Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
@fin09pcap fin09pcap self-assigned this Jan 15, 2026
Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant