GOLand 搭建Go语言开发环境

Go环境: 1.9.2 

IDE: GoLand

第一步 : GO环境安装

Go环境下载地址:https://www.golangtc.com/download


下载好之后,在命令行窗口执行: go env (查看当前的GO开发环境)


Go 环境安装成功。

第二步:安装 IDE

IDE 下载地址:http://www.jetbrains.com/go/?fromMenu

IDE安装就是平常的傻瓜式安装,这里就不多说了。

第三步:搭建环境

GO环境和IDE安装好之后,两者怎么联系起来呢?????

看图:



GOROOT就是IDE的开发环境,打开IDE的配置之后,就自动填充进来了。

除此之外,还需要配置一下你的开发目录,GOPATH,也就是你程序放的目录。

注意:这个是在环境变量里面配置的。


接下来,你就可以用GOLAND创建工程了,但是在运行的时候,部分人会报这样的错。

# runtime
C:\Go\src\runtime\mstkbar.go:151:10: debug.gcstackbarrieroff undefined (type struct { allocfreetrace int32; cgocheck int32; efence int32; gccheckmark int32; gcpacertrace int32; gcshrinkstackoff int32; gcrescanstacks int32; gcstoptheworld int32; gctrace int32; invalidptr int32; sbrk int32; scavenge int32; scheddetail int32; schedtrace int32 } has no field or method gcstackbarrieroff)
C:\Go\src\runtime\mstkbar.go:162:24: division by zero
C:\Go\src\runtime\mstkbar.go:162:43: invalid expression unsafe.Sizeof(composite literal)
C:\Go\src\runtime\mstkbar.go:162:44: undefined: stkbar
C:\Go\src\runtime\mstkbar.go:212:4: gp.stkbar undefined (type *g has no field or method stkbar)
C:\Go\src\runtime\mstkbar.go:213:15: gp.stkbar undefined (type *g has no field or method stkbar)
C:\Go\src\runtime\mstkbar.go:216:23: undefined: stackBarrierPC
C:\Go\src\runtime\mstkbar.go:226:28: gp.stkbarPos undefined (type *g has no field or method stkbarPos)
C:\Go\src\runtime\mstkbar.go:227:19: gp.stkbarPos undefined (type *g has no field or method stkbarPos)
C:\Go\src\runtime\mstkbar.go:248:41: undefined: stkbar
C:\Go\src\runtime\mstkbar.go:227:19: too many errors
错误原因:
安装的GO环境的时候,将GO安装在非C盘,将GO环境安装在 C 盘之后就不会报这个错误了





  • 4
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值