I downloaded a program written in go and wanted to compile it on my Macbook M1 macOS Sonoma 14.2.1. I have tried several commands and some of the errors are:
go build -buildvcs=false
env GOOS=darwin GOARCH=arm64 go build
and this error gives me:
/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1 ld: library 'nsl' not found clang: error: linker command failed with exit code 1 (use -v to see invocation)
CGO_ENABLED=0 go build -buildvcs=false
and this error gives me:
github...: build constraints exclude all Go files in /Users/...
I am a beginner in Go and also in Mac. I have been able to compile this program on Linux but not on my laptop, which is a Mac. Please help
I have tried with
go clean -modcache go mod tidy
among others, I have seen that other users on Mac have been able to solve this type of messages