I think Go needs a flag specified at compile time to work on ARM. Instead of `go build`, run `env GOOS=linux GOARCH=arm64 go build`.
Rust is similar, except it requires the appropriate toolchain to be installed first (1-liner).
It’s probably less effort what I’ve described because there are GitHub Actions that will generate appropriate binaries out of the box.