1.下载安装go
https://www.cnblogs.com/Jack-cx/p/9878213.html
2.下载ide
https://www.golangtc.com/download/liteide
3.安装ide
1.下载后安装即可
2.打开ide ,查看-编辑当前环境
修改配置如下:
# native compiler darwin amd64#GOROOT=/usr/local/go #GOBIN= #GOARCH=amd64 #GOOS=darwin #CGO_ENABLED=1#PATH=$GOROOT/bin:$PATH:/usr/local/bin PATH=$PATH:/usr/local/binLITEIDE_GDB=/usr/local/bin/gdb LITEIDE_MAKE=make LITEIDE_TERM=/usr/bin/open LITEIDE_TERMARGS=-a Terminal LITEIDE_EXEC=/usr/X11R6/bin/xterm LITEIDE_EXECOPT=-e
对于上面编辑ide的时候,我用的mac,可能没有编辑权限,解决办法是sudo -i 切换到root 直接编辑文件即可
4.hello word
package mainimport ("fmt" )func main() {fmt.Println("hello") }
点击编译并且运行的按钮即可
转载于:https://www.cnblogs.com/Jack-cx/p/10105483.html