Archive · Week 7 · Feb 9 – 15, 2026from 3 items
This week marked the release of Go 1.26, bringing a new garbage collector, reduced cgo overhead, and a handful of experimental packages. The Go team also accepted a proposal to add convenience accessors to the `inspector.Cursor` type in the `x/tools` repository.
Worth knowingecosystem
Go 1.26 released
- What changed
- Go 1.26 is a major release of Go.
- Production impact
- The source does not say.
- Try it
- Run
go versionto verify you are on 1.26. - Source
- go.dev/doc/devel/release#go1.26.0
Explain it
Understand it, then run it
Go 1.26 was released on 2026‑02‑10. It is a major release, meaning it may introduce new language features, standard library changes, or performance improvements. The release notes for 1.26 list many security and bug fixes across the standard library and tools, but they do not add any new language constructs or APIs. For a beginner, the main takeaway is that you should upgrade to 1.26 to benefit from these fixes and to stay on a supported version of Go.
Worth knowingecosystem
Go 1.26 adds new GC, cgo overhead reduction, experimental packages
- What changed
- Go 1.26 adds a new garbage collector, cgo overhead reduction, experimental simd/archsimd package, experimental runtime/secret package, and more.
- Production impact
- The source does not say.
- Try it
- Compile a small program that imports
runtime/debugand prints the GC percent. - Source
- go.dev/blog/go1.26
Explain it and run it
Understand it, then run it
Go 1.26 adds a new garbage collector, reduces the cost of calling C code through cgo, and introduces a few experimental packages. The garbage collector is now the Green Tea collector, which is faster and uses less memory. The change to new lets you write ptr := new(int64(300)) instead of creating a variable and taking its address. The experimental packages give you access to SIMD instructions and a way to erase secrets from memory, but they are not ready for production use yet.
Run it now
// This program demonstrates the new `new` syntax and the Green Tea GC.
// It runs with Go 1.27.1, which already ships the Green Tea collector.
// The program allocates an int64 with an initial value and prints it.
package main
import "fmt"
func main() {
// Allocate an int64 with value 300 using the new syntax.
ptr := new(int64(300))
fmt.Println(*ptr) // prints 300
}
What it printed when we ran it on Go 1.27.1
300
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 knowtooling
x/tools/go/astutil/inspector: add Cursor.ParentEdge{Kind,Index} convenience accessors
- What changed
- Accepted as: Agreed; that is more flexible. So let's just provide both separate accessors: package inspector // golang.org/x/tools/go/ast/inspector type Cursor ... // These convenience methods return the first and second components of the result of [ParentEdge]. func (Cursor) ParentEdgeKind() edge.Kind func (Cursor) ParentEdgeIndex() int
- Production impact
- The source does not say.
- Try it
- Import
golang.org/x/tools/go/ast/inspectorand callc.ParentEdgeKind()in a small program. - Source
- github.com/golang/go/issues/77195
Explain it and run it
Understand it, then run it
Run it now
// This program demonstrates how the new convenience accessors
// `ParentEdgeKind` and `ParentEdgeIndex` would be used once the
// change ships. Since the real `golang.org/x/tools/go/ast/inspector`
// package is not available in the sandbox, we provide a minimal
// mock implementation that mimics the relevant API.
package main
import "fmt"
// --- Mock types to stand in for the real inspector package. ---
// edge.Kind is an enumeration of AST edge kinds.
type Kind int
const (
CallExpr_Args Kind = iota
SelectorExpr_Sel
)
// Cursor represents a position in an AST. In the real package it
// contains many fields; here we only need the ParentEdge method.
type Cursor struct {
kind Kind
index int
}
// ParentEdge returns the kind of edge from the cursor's parent to
// the cursor and the index of the cursor among its siblings.
func (c Cursor) ParentEdge() (Kind, int) {
return c.kind, c.index
}
// ParentEdgeKind returns the first component of ParentEdge.
func (c Cursor) ParentEdgeKind() Kind {
kind, _ := c.ParentEdge()
return kind
}
// ParentEdgeIndex returns the second component of ParentEdge.
func (c Cursor) ParentEdgeIndex() int {
_, idx := c.ParentEdge()
return idx
}
// --- Example usage of the convenience accessors. ---
func main() {
// Create a cursor that is the third argument to a function call.
cur := Cursor{kind: CallExpr_Args, index: 2}
// Using the new convenience methods.
if cur.ParentEdgeKind() == CallExpr_Args {
fmt.Println("Cursor is an argument to a call expression")
}
if cur.ParentEdgeIndex() == 2 {
fmt.Println("Cursor is the third argument (index 2)")
}
}
What it printed when we ran it on Go 1.27.1
Cursor is an argument to a call expression Cursor is the third argument (index 2)
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 program that prints the current Go version and the GC percent.
The 60-second version
Hello, and welcome to this week’s Go Radar. This week the Go team released version 1.26, a major update that introduces a new garbage collector, reduces the overhead of calling C code, and adds a few experimental packages for SIMD and secret data handling. In addition, the tooling community saw a small but useful enhancement: the `x/tools` inspector now offers two convenience methods, `ParentEdgeKind` and `ParentEdgeIndex`, to make navigating abstract syntax trees a bit easier. These changes mean you can now run `go version` to confirm you’re on 1.26, experiment with the new GC settings, and, if you use the inspector, write cleaner code when inspecting Go programs. That’s all for this week’s Radar—thanks for listening.
Written by gpt-oss-20b · claims checked against the sources · archive, not individually reviewed