1、mac下使用 brew安装的go
2、go version返回如下
go version go1.3.3 darwin/amd64
3、hello.go代码如下
package main
import "fmt"
func main() {
fmt.Println("Hello Golang")
}
4、go build hello.go 输出如下错误
hello.go:3:8: cannot find package "fmt" in any of:
/usr/local/Cellar/go/1.3.3/src/pkg/fmt (from $GOROOT)
/Users/ryan/go/src/fmt (from $GOPATH)
package runtime: cannot find package "runtime" in any of:
/usr/local/Cellar/go/1.3.3/src/pkg/runtime (from $GOROOT)
/Users/ryan/go/src/runtime (from $GOPATH)
5、/usr/local/Cellar/go/1.3.3/src/下没有src目录,ls的结果如下:
INSTALL_RECEIPT.json etc share
bin libexec
所以,请问这怎么处理?
2、go version返回如下
go version go1.3.3 darwin/amd64
3、hello.go代码如下
package main
import "fmt"
func main() {
fmt.Println("Hello Golang")
}
4、go build hello.go 输出如下错误
hello.go:3:8: cannot find package "fmt" in any of:
/usr/local/Cellar/go/1.3.3/src/pkg/fmt (from $GOROOT)
/Users/ryan/go/src/fmt (from $GOPATH)
package runtime: cannot find package "runtime" in any of:
/usr/local/Cellar/go/1.3.3/src/pkg/runtime (from $GOROOT)
/Users/ryan/go/src/runtime (from $GOPATH)
5、/usr/local/Cellar/go/1.3.3/src/下没有src目录,ls的结果如下:
INSTALL_RECEIPT.json etc share
bin libexec
所以,请问这怎么处理?