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 20 · May 11 – 17, 2026from 6 items

The Go team accepted several proposals that extend the standard library and improve testing ergonomics. The most visible change is the addition of an in‑memory network for `httptest`, while other updates bring new utilities to `math/rand/v2`, `encoding/json/v2`, and certificate handling. The week also saw enhancements to the `go/constant` package and the `crypto/x509` verifier on Darwin and Windows.

Worth knowingstdlib

httptest: synctest support

What changed
The net/http/httptest package now supports an in‑memory network implementation for test servers, avoiding port exhaustion and transient networking issues.
Production impact
The source does not say.
Try it
Create a test server with httptest.NewTestServer(t, handler) and observe that it uses an in‑memory network by default.
Source
github.com/golang/go/issues/76608

Worth knowingstdlib

math/rand/v2: add Rand.N

What changed
The math/rand/v2 package now includes a generic N function that returns a pseudo‑random number in the half‑open interval [0,n) for any integer type.
Production impact
The source does not say.
Try it
Call rand.N[int64](10) in a small program to generate a random number less than 10.
Source
github.com/golang/go/issues/77853
Explain it and run it

Understand it, then run it

Run it now

Todaygo
// This program demonstrates how to get a random number in [0, n) using the
// current standard library.  The new generic Rand.N method is not yet
// available in Go 1.27.1, so we use rand.Intn and cast the result.
package main

import (
	"fmt"
	"math/rand"
)

func main() {
	const n = 10
	// Seed the default source for reproducibility in this example.
	rand.Seed(42)

	// rand.Intn returns an int in [0, n).  We cast to int32 to show type flexibility.
	x := int32(rand.Intn(n))

	fmt.Printf("Random number in [0, %d): %d\n", n, x)
}

What it printed when we ran it on Go 1.27.1

Random number in [0, 10): 1

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

Nice to knowstdlib

crypto/x509: accept non‑string pkix.Name attributes

What changed
The pkix.Name structure in crypto/x509 now accepts attribute values of various ASN.1 types (int64, bool, time.Time, etc.) instead of only strings.
Production impact
The source does not say.
Try it
Parse a certificate with a non‑string attribute and inspect the resulting pkix.Name field.
Source
github.com/golang/go/issues/75260
Explain it and run it

Understand it, then run it

Run it now

Todaygo
// This program demonstrates that pkix.Name can hold non‑string attribute values.
// It constructs a pkix.Name with an INTEGER attribute and prints the result.
// The code compiles and runs on Go 1.27.1.

package main

import (
	"crypto/x509/pkix"
	"encoding/asn1"
	"fmt"
)

func main() {
	// Create a pkix.Name with an INTEGER attribute (value 123).
	name := pkix.Name{
		CommonName: "example.com",
		ExtraNames: []pkix.AttributeTypeAndValue{
			{
				Type:  asn1.ObjectIdentifier{2, 5, 4, 3}, // OID for commonName
				Value: int64(123),                       // INTEGER value
			},
		},
	}

	// Print the constructed name and the type of the attribute value.
	fmt.Printf("Name: %s\n", name.String())
	fmt.Printf("Attribute value type: %T\n", name.ExtraNames[0].Value)
}

What it printed when we ran it on Go 1.27.1

Name: CN=123
Attribute value type: int64

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

Exercise

Write a small program that uses the new encoding/json/v2 package to marshal a struct and prints the JSON string.

Startergo
package main

import (
	"fmt"
	// TODO: import the new json/v2 package
)

type Person struct {
	Name string
	Age  int
}

func main() {
	p := Person{Name: "Alice", Age: 30}
	// TODO: marshal p and print the result
}
Show a solution
Solutiongo
package main

import (
	"fmt"

	jsonv2 "encoding/json/v2"
)

type Person struct {
	Name string
	Age  int
}

func main() {
	p := Person{Name: "Alice", Age: 30}
	b, err := jsonv2.Marshal(p)
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

What it printed when we ran it on Go 1.27.1

{"Name":"Alice","Age":30}

Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.

The 60-second version

This week the Go team added several new utilities to the standard library. They extended the HTTP test server to use an in‑memory network, which helps avoid port exhaustion during tests. The random number package now offers a generic `N` function, and the constant package can report string lengths without allocating. A brand‑new `encoding/json/v2` package was introduced, giving developers a fresh API for JSON. On the security side, the certificate package now respects environment variables on Darwin and Windows, and it accepts a broader set of attribute types in certificate names. These changes are all part of the ongoing effort to make Go’s core packages more powerful and easier to use.

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