agentsclimarketplace

Go 1 21

Skill cedws/skills/go/skills/go-1-21

Apply Go 1.21 language features, tooling, standard-library APIs, migrations, and behaviour changes. Load for Go work targeting 1.21 or later when the model's knowledge may predate the 2023-08-08 release.From its SKILL.md

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

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.5 KB, 724 tokens by cl100k_base, as published. Nobody here has run it

Go 1.21

This overview applies when the project's target Go version is at least 1.21.

Language

  • The built-in min and max functions select an extremum from a fixed set of ordered values without hand-written comparisons.
  • clear can empty a map or zero every element of a slice without deletion or zeroing loops.
  • Type inference covers more generic function arguments, generic function assignments, and interface method matching, reducing the need for explicit type arguments.
  • panic(nil) now produces *runtime.PanicNilError, ensuring that a directly deferred recover returns a non-nil value. GODEBUG=panicnil=1 provides temporary compatibility with the older behaviour.

Toolchains and builds

  • The go directive in go.mod or go.work is a strict minimum version, while the toolchain directive can suggest a newer toolchain without raising the language and module-semantics minimum.
  • Automatic toolchain selection can find or download a newer Go release when a module requires it.
  • Version-sensitive GODEBUG defaults follow the go directive, allowing a newer toolchain to preserve older language-version behaviour.
  • A representative production CPU profile named default.pgo in a main package enables profile-guided optimisation automatically; -pgo controls an explicit profile location or opt-out.
  • go test -fullpath emits unambiguous source paths, and a directory argument to go test -o supports several test binaries.

Generic collection and logging APIs

  • The generic slices and maps packages provide common collection operations that previously required local implementations.
  • cmp.Compare, cmp.Less, and cmp.Ordered support ordered generic algorithms and comparators for slices helpers.
  • log/slog provides structured, levelled logging with keys and values or slog.Attr values.
  • testing/slogtest validates custom slog.Handler implementations.

Standard library

  • context.WithoutCancel allows work to outlive parent cancellation while retaining values. WithDeadlineCause, WithTimeoutCause, and Cause preserve deadline reasons, while AfterFunc registers cancellation-triggered work.
  • errors.ErrUnsupported gives unsupported operations a portable identity through errors.Is.
  • sync.OnceFunc, sync.OnceValue, and sync.OnceValues cover common function and result-caching forms of sync.Once.
  • reflect.SliceHeader and reflect.StringHeader are deprecated; unsafe.Slice, unsafe.SliceData, unsafe.String, and unsafe.StringData are their safer replacements.
  • Low-level crypto/elliptic curve operations are deprecated. crypto/ecdh covers ECDH, while lower-level curve arithmetic requires a maintained implementation.
  • runtime.Pinner allows non-Go code to retain references to explicitly pinned Go memory until it is unpinned.
  • testing.Testing reports whether the running program is a go test binary.

Experimental and compatibility features

  • The per-iteration loop-variable behaviour is a preview in Go 1.21; the language still uses one variable per loop by default.
  • GOEXPERIMENT=cgocheck2 provides the thorough cgo pointer checker, replacing the removed runtime setting GODEBUG=cgocheck=2.
  • Supported systems start at macOS 10.15, Windows 10, and Windows Server 2016.

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.