我正在尝试正确设置 GoLand,以便能够在 Go 中使用它。
我正在尝试运行以下简单的HelloWorld go 项目。
package HelloWorldProject
import "fmt"
func main(){
fmt.Printf("Hello")
fmt.Printf("1+1 = ", 1+1)
}
Run Code Online (Sandbox Code Playgroud)
这是我的控制台的结果:
GOROOT=/usr/local/Cellar/go/1.10/libexec #gosetup
GOPATH=/Users/jeanmac/go #gosetup
/usr/local/Cellar/go/1.10/libexec/bin/go build -i -o /private/var/folders/r5/rfwd1cqd4kv8cmh5gh_qxpvm0000gn/T/___Hello /Users/jeanmac/go/src/github.com/jpere547/HelloWorldProject/Hello.go #gosetup
Compilation finished with exit code 0
Run Code Online (Sandbox Code Playgroud)
我在 Mac OS 上,我使用 Brew 安装了 Go。
结果brew info go:
go: stable 1.10 (bottled), HEAD
Open source programming language to build simple/reliable/efficient software
https://golang.org
/usr/local/Cellar/go/1.10 (8,150 files, 336.9MB) *
Poured from bottle on 2018-03-22 at 19:38:29
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/go.rb
==> Requirements …Run Code Online (Sandbox Code Playgroud)