I have go1.10 installed via Homebrew (had the same issue installing the official golang.org package for macOS).
I'm failing to buid a fairly simple go program:
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/health", healthHandler)
fmt.Println("Listening for connections")
http.ListenAndServe("127.0.0.1:5000", nil)
}
func healthHandler(writer http.ResponseWriter, request *http.Request) {
fmt.Fprint(writer, "Healthy!")
}
go build
fails with:
# crypto/x509
fork/exec /usr/local/bin/gcc-6: no such file or directory
I don't have gcc-6
in my system (I have gcc-7
from both Xcode and Homebrew). Oddly, I can build the same code on a different mac (with same overall setup: go1.10
, no gcc-6
).
I've tried reinstalling the whole go/gcc combo through Homebrew but nothing seems to work. At this point I just feel lost.
Any ideas?