agentsclimarketplace

Go 1 22

Skill cedws/skills/go/skills/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

Install
npx -y skills add cedws/skills --skill go-1-22

Assembled 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 for loop 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=rangefunc enables a preview of range-over-function iterators; it is not a stable Go 1.22 language feature.

Tools and workspaces

  • go work vendor creates a shared vendor directory for a multi-module workspace; that directory cannot simultaneously represent single-module vendoring state.
  • go get no longer works in legacy GOPATH mode, so dependency changes occur inside modules.
  • go test -cover reports zero coverage for packages containing executable code but no tests.
  • go vet detects ineffective append calls, prematurely evaluated time.Since calls in defer, and malformed alternating key-value arguments to log/slog.
  • The refreshed execution tracer supports streamable traces, complete system-call durations, and correlation with operating-system clocks. GOEXPERIMENT=noexectracer2 restores the older tracer temporarily.

Randomness and versions

  • math/rand/v2 is the modern non-cryptographic random-number API, with IntN, UintN, generic N, and the PCG and ChaCha8 sources for local state.
  • crypto/rand.Read remains the API for random bytes that protect secrets; math/rand/v2 is not a substitute.
  • go/version validates and compares Go version strings without ad hoc parsing.

HTTP routing and filesystems

  • http.ServeMux patterns can include HTTP methods and wildcards, with wildcard values available through Request.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=1 temporarily restores the old behaviour.
  • http.ServeFileFS, http.FileServerFS, and http.NewFileTransportFS serve content from an fs.FS.
  • archive/tar.Writer.AddFS and archive/zip.Writer.AddFS add an fs.FS without a manual walk.

Standard library and runtime

  • cmp.Or selects the first non-zero value in an ordered fallback sequence.
  • slices.Concat concatenates multiple slices. Delete, DeleteFunc, Compact, CompactFunc, and Replace now zero obsolete elements.
  • reflect.TypeFor[T]() replaces the reflect.TypeOf((*T)(nil)).Elem() idiom, and reflect.PointerTo replaces deprecated reflect.PtrTo.
  • /sched/pauses/total/gc:seconds replaces the deprecated /gc/pauses:seconds metric, with additional histograms separating stop coordination from complete pauses.
  • go/types can expose alias nodes under GODEBUG=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=1 and tlsrsakex=1 provide temporary legacy compatibility.
  • CertPool.AddCertWithConstraint associates additional chain-building checks with a custom trust root.
  • slices.Insert panics 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.

Keep looking

Skills are one crate of 326,782. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.