Go 1.5+ : Error - imports runtime: C source files not allowed when not using cgo or SWIG

后端 未结 4 856
情书的邮戳
情书的邮戳 2021-02-07 03:07

My program was building perfectly with go 1.4.2. After installing go 1.5, I am getting following error.

imports runtime: C source files not allowed when n

4条回答
  •  名媛妹妹
    2021-02-07 03:41

    I have the same problem because I installed two version of golang on my machine, one from offical site and the other is from homebrew.

    And the GOROOT isn't match the go binary, I just replace the GOROOT with the right one, then done.

    export GOROOT=/usr/local/opt/go/libexec # install via brew
    

提交回复
热议问题