-
Notifications
You must be signed in to change notification settings - Fork 280
Open
Description
Overview
With the migration to Go 1.26, several new language features, standard library additions, and performance improvements are available that can make azd faster, safer, and more readable.
Free Performance Wins (no code changes needed)
Simply building with Go 1.26 provides:
- Green Tea GC (default in 1.26): 10–40% GC overhead reduction
- Swiss Tables map implementation (1.24): 2–3% CPU reduction
io.ReadAlloptimization (1.26): ~2x faster, lower memory- cgo overhead reduction (1.26): ~30% faster cgo calls
- Stack-allocated slice backing (1.25/1.26): fewer heap allocations
Current State
The codebase is already well-modernized:
- ✅ 266 usages of
slices/mapspackages - ✅ Zero
ioutilusages (fully migrated) - ✅
errors.Joinin use for multi-error scenarios - ✅
context.WithoutCancelused where appropriate - ✅
anyused throughout (only 7 hand-writteninterface{}remain)
Sub-Issues
Quick Wins (trivial changes)
- Go 1.26: Run go fix automated modernizations #7082 —
go fixautomated modernizations - Go 1.26: Replace math.Min and sort.Strings with builtins #7083 — Built-in
min()+slices.Sortreplacements - Go 1.26: Use slices.Clone and slices.Sorted(maps.Keys(...)) #7084 —
slices.Clone+slices.Sorted(maps.Keys(...))one-liners - Go 1.26: Range-over-int modernization #7088 — Range-over-int conversions
Standard Library Upgrades
- Go 1.26: Migrate sort.Slice to slices.SortFunc — account package #7085 —
sort.Slice→slices.SortFunc(account package) - Go 1.26: Migrate sort.Slice to slices.SortFunc — remaining packages #7086 —
sort.Slice→slices.SortFunc(remaining packages) - Go 1.26: Replace http.NewRequest with http.NewRequestWithContext #7087 —
http.NewRequest→http.NewRequestWithContext
New Go 1.25/1.26 Feature Adoption
- Go 1.26: Adopt errors.AsType[T] — Azure API error paths #7090 —
errors.AsType[T]— Azure API error paths - Go 1.26: Adopt errors.AsType[T] — infra/provisioning #7091 —
errors.AsType[T]— infra/provisioning - Go 1.26: Adopt errors.AsType[T] — commands and actions #7092 —
errors.AsType[T]— commands/actions - Go 1.26: Adopt WaitGroup.Go for concurrent patterns #7093 —
WaitGroup.Gofor concurrent patterns - Go 1.26: Create generic SyncMap[K, V] utility type #7089 — Generic
SyncMap[K, V]utility type
Test Modernization
- Go 1.26: Test modernization — T.Context() adoption #7094 —
T.Context()adoption - Go 1.26: Test modernization — T.Chdir() adoption #7095 —
T.Chdir()adoption
Future (require design discussion)
omitzeroJSON struct tagsos.Rootsecure file accessslogstructured logging (309 sites)testing/synctestfor retry/timeout tests
Analysis
Full analysis document with file-level details, code examples, and before/after comparisons is available in tmp/go-1.26-modernization-analysis.md in the repository.
References
Reactions are currently unavailable