您的位置:首页 > 编程语言 > Go语言

GOLand 搭建Go语言开发环境

2018-01-20 21:10 609 查看
Go环境: 1.9.2 IDE: GoLand第一步 : GO环境安装Go环境下载地址:https://www.golangtc.com/download下载好之后,在命令行窗口执行: go env (查看当前的GO开发环境)Go 环境安装成功。第二步:安装 IDEIDE 下载地址:http://www.jetbrains.com/go/?fromMenuIDE安装就是平常的傻瓜式安装,这里就不多说了。第三步:搭建环境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 盘之后就不会报这个错误了

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: