Mac下eclipse之go语言插件安装

版权声明:您好,欢迎来到我的技术博客。 https://blog.csdn.net/zwyjg/article/details/82948781

1.安装GO

安装包下载地址为:https://golang.org/dl/
如果打不开可以使用这个地址:https://golang.google.cn/dl/
默认安装

2.环境变量配置

(1)终端命令 : vim .bash_profile
插入以下代码

			export GOPATH=~/Users/hoofan/go-workspace
			export GOROOT=~/usr/local/go
			export PATH=$GOROOT/bin:$GOPATH/bin:$PATH

(2)更新刚配置的环境变量
输入source .bash_profile

3.安装插件

https://raw.githubusercontent.com/GoClipse/goclipse.github.io/0.16.0/releases/

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

大功告成啦,我们来跑一个例子:

package main
import (
    "fmt"
)
func main() {
    fmt.Println("hello world")
}

不过最最最重要的一个,千万要记住!eclipse的工作目录一定要在:/Users/hoofan/go-workspace/src/yourproject里面,很多人如果不注意,就会遇到“Resource doesn’t have a corresponding Go package" 的错误。

猜你喜欢

转载自blog.csdn.net/zwyjg/article/details/82948781