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

Radar · Go · Archive · Week 13 · Mar 23 – 29, 2026

go-blog: Type Construction and Cycle Detection

Nice to knowlanguage

What changed
Go 1.26 simplifies type construction and enhances cycle detection for certain kinds of recursive types.
Production impact
The source does not say.
Try it
Read the blog post to understand the new type‑construction rules and experiment with recursive type definitions in a Go 1.26 environment.
Source
go.dev/blog/type-construction-and-cycle-detection

Understand it, then run it

Run it now

Todaygo
// This program demonstrates a simple recursive type that compiles
// thanks to Go 1.26's improved type construction. It prints the
// size of the slice element type to show that the compiler has
// resolved the recursion.

package main

import (
	"fmt"
	"unsafe"
)

// Node is a recursive type: each node points to another Node.
type Node struct {
	next *Node
}

func main() {
	// Create a slice of Nodes to exercise the recursive type.
	nodes := make([]Node, 3)

	// Link the nodes together.
	for i := 0; i < 2; i++ {
		nodes[i].next = &nodes[i+1]
	}

	// Print the size of the Node type to confirm the compiler
	// has constructed it correctly. The size includes a pointer.
	fmt.Printf("Size of Node: %d bytes\n", unsafe.Sizeof(Node{}))
}

What it printed when we ran it on Go 1.27.1

Size of Node: 8 bytes

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.

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