当前位置:网站首页>Goland 调试go使用-大白记录
Goland 调试go使用-大白记录
2022-04-23 07:23:00 【mygugu】
前提环境检验:
goland安装成功;
go环境变量已配置,验证:
cmd----输入go version可显示版本信息,如下:
![]()
查看go 环境信息,通过命令go env实现,如下:主要关注下GOPATH

至此,环境完成!
Bug修复:
- git clone代码后,goland打开报错
GoLand:Cannot resolve symbol
以及sync dependencies ofxxx时也报错,但是运行官方示例代码就可以正常。
后来发现是GOPATH设置问题,修改如下:
setting---Go--GoPath,将Global Path 和Project GOPATH处都添加上自己设置的GOPATH路径。如上图go env 所示。再重新点击sync dependencies of xxx自动安装需要的包就可以了。
若在go build时出现类似
go: could not create module cache: mkdir C:\Program Files\Go\bin\pkg: Access is denied.
也是因为代码没有放在GOPATH指定目录下,把代码放到GOPATH目录下,再go build就成功了。
补充:
GOROOT和GOPATH区别:
GOROOT:即go安装路径,一般无大碍。
GOPATH存的是项目代码,是开发时的工作目录。
此外GOPATH可设置多个目录:
Windows下:中间用“;”隔开
GOPATH=C:/path1;C:/path2;
Linux下:中间用“:”分隔
GOPATH="/xxx/path1:/xxx/path2"
注意:
go get 时默认安装到第一个GOPATH路径
go build时,有时会报同一种类型或方法不匹配,由于多个是GOPATH路径顺序不对导致的,调换一下顺序即可解决
goland连接远程服务器:
如下图:settings---Tools---SSH Configurations(有教程说Deployment,但我没找到)
一开始没有连接信息,点击“+”添加即可,写上自己远程服务器用户名,IP,密码,端口号,可以Test connection测试下。

(2)Terminal端连接远程服务器,直接ssh 用户名@服务器IP即可,输入密码,就行了。
版权声明
本文为[mygugu]所创,转载请带上原文链接,感谢
https://blog.csdn.net/mygugu/article/details/124321354
边栏推荐
- vslam PPT
- 3C裝配中的機械臂運動規劃
- Usage of databinding
- C language learning record -- use and analysis of string function (2)
- 【Appium】测试时遇到手机内嵌H5页面的切换问题
- Somme numérique de la chaîne de calcul pour un problème simple de leetcode
- Online yaml to XML tool
- Sword finger offer Day24 math (medium)
- idea:使用easyYapi插件导出yapi接口
- There are some problems when using numeric type to query string type fields in MySQL
猜你喜欢

搜一下导航完整程序源码

Draw a circle quickly in MATLAB (the one that can be drawn directly given the coordinates and radius of the center of the circle)

WordPress爱导航主题 1.1.3 简约大气网站导航源码网址导航源码

Comparison of indoor positioning methods of several intelligent robots

AQS & ReentrantLock 实现原理

Qt利用QtXlsx操作excel文件

The simple problem of leetcode is to calculate the numerical sum of strings

My heart's broken! A woman's circle of friends envied others for paying wages on time and was fired. Even her colleagues who liked her were fired together

PyQt5开发之QTableWidget表头自定义与美化(附源代码下载)

freertos学习02-队列 stream buffer message buffer
随机推荐
[effective go Chinese translation] function
php生成短链接:将数字转成字母,将字母转成数字
基于TCP/IP协议的网络通信实例——文件传输
Interesting JS code
数据的删除和修改操作(mysql)
colorui 解决底部导航遮挡内容问题
利用Js实现一个千分位
Qt利用QtXlsx操作excel文件
js将树形结构数据转为一维数组数据
编译原理题-带答案
浅谈ES6尾调优化
Data deletion and modification (MySQL)
PyQt5开发之QTableWidget表头自定义与美化(附源代码下载)
Rotation function of leetcode medium problem
单点登录 SSO
每周leetcode - 06 数组专题 7~739~50~offer 62~26~189~9
LeetCode15. Sum of three
Rearranging log files for leetcode simple question
Qt读写XML文件
Ubuntu安装Mysql并查询平均成绩