refactor: move codebase to go 1.26#4149
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the repository’s Go language version to Go 1.26 and applies the related syntax modernizations across the codebase to reduce boilerplate (notably around error type matching and pointer-to-literal patterns).
Changes:
- Bump
godirectives to Go 1.26 / 1.26.0 across modules. - Replace
errors.As+ temp variables witherrors.AsType[T]in multiple call sites. - Replace “take address of local temp” patterns with
new(<expr>)pointer creation where applicable.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/errs/ontap.go | Uses errors.AsType[*RestError] to simplify REST error detection. |
| pkg/conf/conf_test.go | Simplifies boolean pointer setup with new(true/false) in tests. |
| pkg/conf/conf.go | Uses new(logSet.GetAllChildNamesS()) instead of local var + address. |
| pkg/api/ontapi/zapi/client.go | Refactors HarvestError detection to errors.AsType. |
| mcp/go.mod | Updates module Go version to 1.26. |
| integration/test/promtool_metrics_test.go | Refactors ExitError detection to errors.AsType. |
| integration/test/copy_logs_test.go | Refactors ExitError detection to errors.AsType. |
| integration/go.mod | Updates module Go version to 1.26.0. |
| integration/certer/main.go | Refactors OntapError detection to errors.AsType. |
| go.mod | Updates main module Go version to 1.26.0. |
| cmd/tools/rest/rest.go | Refactors RestError detection to errors.AsType. |
| cmd/tools/rest/client.go | Refactors RestError detection to errors.AsType. |
| cmd/poller/poller.go | Uses new(append(...)) to avoid temp slice variable when updating templates. |
| cmd/exporters/victoriametrics/victoriametrics.go | Uses new(<expr>) for default pointers and URL pointer creation. |
| cmd/exporters/influxdb/influxdb.go | Uses new(<expr>) for default pointers and URL pointer creation. |
| cmd/collectors/storagegrid/rest/client.go | Refactors StorageGridError detection to errors.AsType. |
| cmd/collectors/power.go | Refactors RestError detection to errors.AsType (with status check). |
| cmd/collectors/eseries/rest/client.go | Refactors RestError detection to errors.AsType. |
| cmd/collectors/discovery.go | Refactors HarvestError detection to errors.AsType. |
| cmd/collectors/cisco/rest/client.go | Refactors HarvestError detection to errors.AsType. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rahulguptajss
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://blog.jetbrains.com/go/2026/02/13/moving-your-codebase-to-go-1-26-with-goland-syntax-updates/