chore(go,deps): bump to Go 1.26.1; update tooling; migrate sort to slices.SortFunc#91
Open
chore(go,deps): bump to Go 1.26.1; update tooling; migrate sort to slices.SortFunc#91
Conversation
…ices.SortFunc
Toolchain
- Go: 1.26.0 -> 1.26.1 (go.mod + test/pre-commit hooks + env)
- golangci-lint: v2.10.1 -> v2.11.3 (pre-commit hook)
- buf: v1.66.0 -> v1.66.1 (.project-settings.env)
Dependencies (go.mod/go.sum)
- github.com/goccy/go-json: v0.10.5 -> v0.10.6
- go.opentelemetry.io/otel{,/metric,/trace}: v1.40.0 -> v1.42.0
- golang.org/x/{crypto,net,sys,text}: v0.48.0/0.51.0/0.41.0/0.34.0 -> v0.49.0/0.52.0/0.42.0/0.35.0
Code
- Replace sort.Slice with slices.SortFunc for deterministic, typed comparators:
- internal/cluster/ring.go
- pkg/backend/dist_memory.go
- pkg/backend/filters.go
- merkle sorting helpers
Notes
- No functional behavior changes expected; aligns code with Go 1.26 stdlib APIs and refreshes tooling.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the repository’s Go toolchain/developer tooling versions and refreshes dependency pins, while modernizing in-code sorting to use slices.SortFunc comparators.
Changes:
- Bump toolchain/tooling versions (Go, golangci-lint, buf) across
go.mod, env, Makefile, and pre-commit hooks. - Update Go module dependencies (otel, go-json, golang.org/x/*) via
go.mod/go.sum. - Replace several
sort.Slice/sort.Sortusages withslices.SortFuncin backend and cluster code paths.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/backend/filters.go | Switch item sorting to slices.SortFunc with a typed comparator. |
| pkg/backend/dist_memory.go | Sort Merkle entries with slices.SortFunc + strings.Compare; drop sort import. |
| internal/cluster/ring.go | Sort virtual nodes with slices.SortFunc (keeps sort.Search for lookup). |
| go.mod | Bumps Go version + core deps (otel/go-json/x/*). |
| go.sum | Updates module hashes to match updated deps. |
| Makefile | Updates pinned tool versions (Go, buf, golangci-lint). |
| .project-settings.env | Updates pinned tool versions consumed by hooks/Makefile. |
| .pre-commit/unit-test-hook | Updates default Go toolchain version used for tests. |
| .pre-commit/golangci-lint-hook | Updates default golangci-lint version. |
| .golangci.yaml | Updates configured Go version for lint runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| # Mainly related to generics support since go1.18. | ||
| # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.17 | ||
| go: "1.26.0" | ||
| go: "1.26.1" |
Comment on lines
+98
to
+102
| slices.SortFunc(items, func(a, b *cache.Item) int { | ||
| switch { | ||
| case sorter.less(a, b): | ||
| return -1 | ||
| case sorter.less(b, a): |
| module github.com/hyp3rd/hypercache | ||
|
|
||
| go 1.26.0 | ||
| go 1.26.1 |
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.
Toolchain
Dependencies (go.mod/go.sum)
Code
Notes