This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Quiet Pager · Radar

What changed in Go, Rust and Solidity this week.

What changed this week, from each project's own release notes, proposals and issues, with an exercise you can run for each change.

Written by a model · reviewed by a person · published Mondays · Atom feed

Archive · Week 25 · Jun 16 – 22, 2025from 2 items

This week the Go team accepted two proposals that add new APIs to the standard library. One introduces a generic hashing interface in the `maphash` package, and the other adds a helper method for working with process handles in the `os` package.

Worth knowingstdlib

hash/maphash: standardize the hash function

What changed
The proposal adds a generic Hasher[T any] interface and a ComparableHasher[T comparable] implementation to package maphash.
Production impact
The source does not say.
Try it
Import maphash and declare a type that implements Hasher[int] to see the new API.
Source
github.com/golang/go/issues/70471
Explain it

Understand it, then run it

The Go standard library has a package called hash/maphash that is used internally by maps to compute hash values. In older versions, the package did not expose a clear way for users to define their own hash functions for custom types. The change adds a generic interface called Hasher[T any] and a helper type ComparableHasher[T comparable]. Hasher describes two methods: Hash, which writes the hash of a value into a maphash.Hash, and Equal, which tells whether two values are considered the same for hashing purposes. ComparableHasher implements this interface for any type that already supports the == operator, so you can use it without writing extra code. With this change you can now write your own hash logic that works with Go’s map implementation, rather than relying on the default hashing of built‑in types.

Worth knowingstdlib

os: add (*Process).WithHandle

What changed
A new method WithHandle on os.Process calls a supplied function with a valid process handle (pidfd on Linux 5.4+ or a Windows handle). If no handle is available it returns ErrNoHandle.
Production impact
The source does not say.
Try it
Create an os.Process and call WithHandle to print the handle value.
Source
github.com/golang/go/issues/70352

Exercise

Write a small program that creates a child process, then uses (*os.Process).WithHandle to print the process handle. The program should compile and run on Linux 5.4+ or Windows; on other systems it should print the error returned by ErrNoHandle.

The 60-second version

Hello, this week the Go team added two new helpers to the standard library. First, in the `maphash` package, they introduced a generic `Hasher` interface and a ready‑made `ComparableHasher` for comparable types. This lets you write type‑specific hash functions that are guaranteed to be stateless and consistent with equality. Second, the `os` package now offers a `WithHandle` method on `os.Process`. It gives you a safe way to access the underlying process handle—whether that’s a pidfd on recent Linux kernels or a Windows handle—by calling a callback while the handle is guaranteed to be valid. These additions give developers more fine‑grained control over hashing and process interaction without breaking existing code.

Written by gpt-oss-20b · claims checked against the sources · archive, not individually reviewed