package main
import “fmt”
func main() {
fmt.Println(“Hello, 世界”)
}
[andy@s1 test]$ go build hello.go
hello.go:3:8: cannot find package “fmt” in any of:
/usr/local/go/src/pkg/fmt (from $GOROOT)
($GOPATH not set)
package runtime: cannot find package “runtime” in any of:
/usr/local/go/src/pkg/runtime (from $GOROOT)
($GOPATH not set)
linux中程序编译出现这样的错误,求大神帮助解答。
GOROOT=/usr/local/go/
和GOPATH应该没关系,即使设置了也没用。
标准包的源码都在GOROOT的src下 为什么自动去src/pkg下找。
之前环境是可以的,后来配置了一下gocode等vim的go编辑环境就便这样了
import “fmt”
func main() {
fmt.Println(“Hello, 世界”)
}
[andy@s1 test]$ go build hello.go
hello.go:3:8: cannot find package “fmt” in any of:
/usr/local/go/src/pkg/fmt (from $GOROOT)
($GOPATH not set)
package runtime: cannot find package “runtime” in any of:
/usr/local/go/src/pkg/runtime (from $GOROOT)
($GOPATH not set)
linux中程序编译出现这样的错误,求大神帮助解答。
GOROOT=/usr/local/go/
和GOPATH应该没关系,即使设置了也没用。
标准包的源码都在GOROOT的src下 为什么自动去src/pkg下找。
之前环境是可以的,后来配置了一下gocode等vim的go编辑环境就便这样了