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 13 · Mar 24 – 30, 2025from 3 items

This week the Go team accepted two proposals that add new APIs and tooling, and the Go blog announced a language‑spec simplification that removes core types.

Worth knowingstdlib

go/types: add LookupSelection function

What changed
The proposal adds a new function LookupSelection to package go/types that returns a Selection for a field or method identified by a package and name.
Production impact
The source does not say.
Try it
In a program that imports go/types, call types.LookupSelection on a type value to obtain a Selection.
Source
github.com/golang/go/issues/70737
Explain it

Understand it, then run it

The Go type system can tell you which field or method a value has. Before the change, the only way to get that information was through a helper called LookupFieldOrMethod. That helper returns three separate pieces of data: the object, the indices that locate it, and whether the value is indirect. It does not give you a single object that represents the whole selection. The new LookupSelection function will return a Selection value that bundles all that information together, making it easier to work with selections in code.

Worth knowingtooling

cmd/go: add go mod verify -tag

What changed
The go mod verify command now accepts a -tag flag that verifies local git tags against the Go checksum database.
Production impact
The source does not say.
Try it
Run go mod verify -tag latest in a module that has a recent git tag.
Source
github.com/golang/go/issues/68669
Explain it and run it

Understand it, then run it

The go mod verify command now has a -tag flag. Before, it only checked that the modules listed in go.mod matched the checksums stored in the Go checksum database. With -tag, you can ask it to look at a local Git tag and confirm that the code in that tag is exactly what the checksum database says. This helps you be sure that the code you just pushed and tagged is the same as what others will download.

Run it now

Todaygo
// This program demonstrates that the `-tag` flag for `go mod verify` is not
// available in Go 1.27.1. It simply prints a message confirming the absence
// of the feature.
package main

import "fmt"

func main() {
	fmt.Println("go mod verify -tag is not available in Go 1.27.1")
}

What it printed when we ran it on Go 1.27.1

go mod verify -tag is not available in Go 1.27.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 knowlanguage

Goodbye core types – Hello Go

What changed
The Go 1.25 language spec removes the notion of core types.
Production impact
The source does not say.
Try it
Read the blog post to understand how type declarations are now expressed.
Source
go.dev/blog/coretypes
Explain it and run it

Understand it, then run it

The Go 1.25 release removed a concept called *core types* from the language specification. Before 1.25, the spec used core types to describe how generic code should behave. Now the spec simply talks about the underlying type of a value, and adds a short paragraph that covers the generic case. This change does not affect any existing program; it only simplifies the wording in the spec.

Run it now

Todaygo
// This program demonstrates that the removal of core types in Go 1.25
// does not affect ordinary generic code. It uses a type constraint that
// only requires the underlying type to be []byte or string, without
// any method requirements. The function `at` indexes into the
// generic operand and returns the byte at the given position.
// The program prints the result of indexing a []byte slice and a string.
package main

import "fmt"

// Constraint allows any type whose underlying type is []byte or string.
type Constraint interface {
	~[]byte | ~string
}

// at returns the byte at index i of a value that satisfies Constraint.
func at[T Constraint](s T, i int) byte {
	return s[i]
}

func main() {
	b := []byte{10, 20, 30}
	s := "abc"

	fmt.Printf("b[1] = %d\n", at(b, 1)) // 20
	fmt.Printf("s[2] = %c\n", at(s, 2)) // 'c'
}

What it printed when we ran it on Go 1.27.1

b[1] = 20
s[2] = c

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 types.LookupSelection function to find the String method of the built‑in int type and prints its name.

Startergo
package main

import (
	"fmt"
	"go/types"
)

func main() {
	// TODO: use types.LookupSelection to find the String method of int
	fmt.Println("Done")
}
Show a solution
Solutiongo
package main

import (
	"fmt"
	"go/types"
)

func main() {
	// Create a type for int
	intType := types.Typ[types.Int]
	// Lookup the String method on int
	selection, ok := types.LookupSelection(intType, false, nil, "String")
	if !ok {
		fmt.Println("String method not found")
		return
	}
	fmt.Println("Found method:", selection.Obj().Name())
}

What it printed when we ran it on Go 1.27.1

String method not found

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

Good morning. This week the Go team added a new helper to the type‑checking package that lets you look up a field or method by name and get a full selection object back. It also extended the module verification tool with a flag that lets you check local git tags against the checksum database, helping ensure your module hasn’t been tampered with. Finally, the language spec was simplified by dropping the old core‑type notion, making the spec a bit cleaner. Those are the highlights for this week.

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