当前位置:网站首页>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
边栏推荐
- JS common array methods
- There are some problems when using numeric type to query string type fields in MySQL
- Smart business card applet business card details page function implementation key code
- 3C裝配中的機械臂運動規劃
- 总线结构概述
- LeetCode15. Sum of three
- dmp引擎工作总结(2021,光剑)
- The whole house intelligence bet by the giant is driving the "self revolution" of Hisense, Huawei and Xiaomi
- 編譯原理題-帶答案
- Data deletion and modification (MySQL)
猜你喜欢

LeetCode简单题之三除数

AAAI 2022 recruit speakers!!

5.6 综合案例-RTU-

One click cleanup of pycharm and jupyter cache files under the project
![[untitled]](/img/bb/213d95b60651dfeadb239a70507506.png)
[untitled]

There are some problems when using numeric type to query string type fields in MySQL

社区团购小程序源码+界面diy+附近团长+供应商+拼团+菜谱+秒杀+预售+配送+直播

如何在SQL Server中导入excel数据,2019版

Qt利用QtXlsx操作excel文件

LeetCode中等题之旋转函数
随机推荐
输入/输出系统
Brief description of CPU
一个没啥L用,但可以装X的IDEA插件
[effective go Chinese translation] part I
LeetCode简单题之计算字符串的数字和
Weekly leetcode - 06 array topics 7 ~ 739 ~ 50 ~ offer 62 ~ 26 ~ 189 ~ 9
Campus transfer second-hand market source code download
Qt读取路径下所有文件或指定类型文件(含递归、判断是否为空、创建路径)
Qt读写XML文件
Convert object to URL
dried food! Point based: differentiable Poisson solver
搜一下导航完整程序源码
QFileDialog 选择多个文件或文件夹
js常用数组方法
【学习】从零开始的音视频开发(9)——NuPlayer
Penetration test interview collection -- HVV---
青苹果影视系统源码 影视聚合 影视导航 影视点播网站源码
在MATLAB中快速画圆(给出圆心坐标和半径就能直接画的那种)
如何保护开源项目免遭供应链攻击-安全设计(1)
剑指offer day24 数学(中等)