Go 1 22
Apply Go 1.22 language features, tooling, standard-library APIs, migrations, and behaviour changes. Load for Go work targeting 1.22 or later when the model's knowledge may predate the 2024-02-06 release.From its SKILL.md
npx -y skills add cedws/skills --skill go-1-22Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
3 things to look at
- 25 days oldThe repository was created 25 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.6 KB, 792 tokens by cl100k_base, as published. Nobody here has run it
Go 1.22
This overview applies when the project's target Go version is at least 1.22.
Language
- Loop variables declared by a
forloop are distinct for every iteration, making defensive shadow assignments for closures and goroutines unnecessary. - Integer ranges iterate from zero to one less than a bound.
for index := range count {
process(index)
}
GOEXPERIMENT=rangefuncenables a preview of range-over-function iterators; it is not a stable Go 1.22 language feature.
Tools and workspaces
go work vendorcreates a shared vendor directory for a multi-module workspace; that directory cannot simultaneously represent single-module vendoring state.go getno longer works in legacyGOPATHmode, so dependency changes occur inside modules.go test -coverreports zero coverage for packages containing executable code but no tests.go vetdetects ineffectiveappendcalls, prematurely evaluatedtime.Sincecalls indefer, and malformed alternating key-value arguments tolog/slog.- The refreshed execution tracer supports streamable traces, complete system-call durations, and correlation with operating-system clocks.
GOEXPERIMENT=noexectracer2restores the older tracer temporarily.
Randomness and versions
math/rand/v2is the modern non-cryptographic random-number API, withIntN,UintN, genericN, and the PCG and ChaCha8 sources for local state.crypto/rand.Readremains the API for random bytes that protect secrets;math/rand/v2is not a substitute.go/versionvalidates and compares Go version strings without ad hoc parsing.
HTTP routing and filesystems
http.ServeMuxpatterns can include HTTP methods and wildcards, with wildcard values available throughRequest.PathValue.
mux.HandleFunc("GET /items/{id}", func(writer http.ResponseWriter, request *http.Request) {
id := request.PathValue("id")
serveItem(writer, request, id)
})
- Braces, escaped paths, and conflicting patterns can behave differently under the new routing semantics;
GODEBUG=httpmuxgo121=1temporarily restores the old behaviour. http.ServeFileFS,http.FileServerFS, andhttp.NewFileTransportFSserve content from anfs.FS.archive/tar.Writer.AddFSandarchive/zip.Writer.AddFSadd anfs.FSwithout a manual walk.
Standard library and runtime
cmp.Orselects the first non-zero value in an ordered fallback sequence.slices.Concatconcatenates multiple slices.Delete,DeleteFunc,Compact,CompactFunc, andReplacenow zero obsolete elements.reflect.TypeFor[T]()replaces thereflect.TypeOf((*T)(nil)).Elem()idiom, andreflect.PointerToreplaces deprecatedreflect.PtrTo./sched/pauses/total/gc:secondsreplaces the deprecated/gc/pauses:secondsmetric, with additional histograms separating stop coordination from complete pauses.go/typescan expose alias nodes underGODEBUG=gotypesalias=1, so named-looking types are not necessarily*types.Named.
Security and compatibility
- TLS servers with no explicit minimum require TLS 1.2, and pre-TLS 1.3 defaults exclude non-ECDHE cipher suites.
tls10server=1andtlsrsakex=1provide temporary legacy compatibility. CertPool.AddCertWithConstraintassociates additional chain-building checks with a custom trust root.slices.Insertpanics for every out-of-range insertion index, including when no values are inserted.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.