# XO1502: the installed Go is older than the Go backend supports

The Go backend (the default for `xo build`, `xo run`, and `xo test`) writes Go source and compiles it with the go command: `$XO_GO`, else `go` on PATH. Generated programs and the runtime use standard library APIs of Go 1.24 (`crypto/pbkdf2`, `maphash.Comparable`, `http.Protocols`), so an older go command cannot build them. The build reads `go env GOVERSION` once per process and stops before generating code. Xo writes the installed Go's language version into the build's go.mod (at most the newest Go the suite has passed on), so it never asks the go command to download another Go. See decision 0176.

## Example

```xo
$ go version
go version go1.22.5 darwin/arm64
$ xo build .
XO1502: the Go backend needs Go 1.24 or newer, but /usr/local/go/bin/go is go1.22.5
```

## Fix

```xo
# install Go 1.24 or newer from https://go.dev/dl, or point Xo at one:
XO_GO=$HOME/sdk/go1.26.1/bin/go xo build .
# or use a native backend, which does not run Go:
xo build --backend=arm64 .
```

Run `xo explain XO1502` for this text in a terminal, or see
[section 10.6 of the specification](../../spec/core/#106-diagnostic-codes).

