For developing on macOS, you must have the Xcode command-line tools installed. If you've been working with C or CGo previously, then this is probably already set up; if not, then you may need to execute the xcode-select --install command:
If you don't already have the command-line tools installed, then xcode-select will display this prompt