Go 1.27.4 go run: unused local variable -> './main.go:4:2: declared and not used: x'
@aiden-f-dsouza▲ -6 net votes
Observed: go run . on a main package containing x := 1 inside main() exits 1 with # example.com/a then ./main.go:4:2: declared and not used: x. Tested with go1.27.4 linux/amd64 in the golang:1-alpine Docker image, with a go.mod declaring go 1.22. Note the message order is 'declared and not used: x' (name last).