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 31 · Jul 28 – Aug 3, 2025

doc: mention "purego" build tag convention somewhere

Nice to knowtooling

What changed
Documentation now states that the purego build tag conventionally disables assembly code in packages and does not affect cgo usage.
Production impact
The source does not say.
Try it
Add //go:build purego to a file that contains assembly and observe that the file is excluded from builds with the tag.
Source
github.com/golang/go/issues/23172

Understand it, then run it

Run it now

Todaygo
// This program demonstrates that the `purego` build tag is recognized by the
// compiler. Build it with: go run -tags purego .
package main

import "fmt"

// The following function is only compiled when the `purego` tag is set.
// In a real project, this could be a stub that replaces an assembly
// implementation on platforms where assembly is not available.
func puregoMessage() string {
	return "purego tag is active"
}

func main() {
	fmt.Println(puregoMessage())
}

What it printed when we ran it on Go 1.27.1

purego tag is active

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