vscode 报错package xxx is not in GOROOT(path) 或者go: to add module requirements and sums: go mod tidy

看了很多帖子然而解决不了问题,我自己多次实践,最终得到了解决

开启项目前本人配置了两个环境变量:

1.

2.

 

一开始遇到的问题:

1.

这里的问题是:我打开一个文件夹hello_go ,hello_go里放了hello项目,直接对hello,进行go mod init hello  ,这里会直接出现问题的。解决这个问题就是如下 :

VScode打开文件夹,对打开的文件夹,在终端进行:go mod init hello  即可解决问题 

2.上面是打开单个项目,如果想一个文件夹下放多个项目,就需要创建工作区。

可以点击 文件  ,找到  将文件夹添加到工作区   找到自己创建好的文件夹即可,然后还是在文件里,找到 将工作区另存为,将生成的文件,保存到上面同一个的文件夹中即可。如下图:

 我的文件夹是my_workspace , 上述的文件放在了my_workspace下(工作区的名称,在上面保存的时候可以更改) 。接下来注意:只需要对 my_workspace 进行go mod init my_workspace  即可。

无需对 my_workspace 里  hello  和 hello2  这两个项目进行 go mod init  ×××  操作,否则会报错,重复了

 

 成功运行。这里

import  " "  ,  双引号里  my_workspace  代表 根目录  不写会出错

错误情况:

1.

 上面情况是对  hello   进行了  go mod init hello  操作 ,没有对 my_workspace   进行 go mod init 。

2.

 这里是  对  my_worksapce   和  hello   都进行了  go mod init   , 同样会出问题。

以上就是使用  vscode ,创建golang项目时,踩过的坑。记录下来分享,最后祝大家学习顺利。

  • 9
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Nmap, or Network Mapper, is a free, open source tool that is available under the GNU General Public License as published by the Free Software Foundation. It is most often used by network administrators and IT security professionals to scan corporate networks, looking for live hosts, specific services, or specific operating systems. Part of the beauty of Nmap is its ability to create IP packets from scratch and send them out utilizing unique methodologies to perform the above-mentioned types of scans and more. This book provides comprehensive coverage of all Nmap features, including detailed, real-world case studies. . Understand Network Scanning Master networking and protocol fundamentals, network scanning techniques, common network scanning tools, along with network scanning and policies. . Get Inside Nmap Use Nmap in the enterprise, secure Nmap, optimize Nmap, and master advanced Nmap scanning techniques. . Install, Configure, and Optimize Nmap Deploy Nmap on Windows, Linux, Mac OS X, and install from source. . Take Control of Nmap with the Zenmap GUI Run Zenmap, manage Zenmap scans, build commands with the Zenmap command wizard, manage Zenmap profiles, and manage Zenmap results. . Run Nmap in the Enterprise Start Nmap scanning, discover hosts, port scan, detecting operating systems, and detect service and application versions . Raise those Fingerprints Understand the mechanics of Nmap OS fingerprinting, Nmap OS fingerprint scan as an administrative tool, and detect and evade the OS fingerprint scan. . "Tool" around with Nmap Learn about Nmap add-on and helper tools: NDiff--Nmap diff, RNmap--Remote Nmap, Bilbo, Nmap-parser. . Analyze Real-World Nmap Scans Follow along with the authors to analyze real-world Nmap scans. . Master Advanced Nmap Scanning Techniques Torque Nmap for TCP scan flags customization, packet fragmentation, IP and MAC address spoofing, adding decoy scan source IP addresses, add random data to sent packets, manipulate time-to-live fields, and send packets with bogus TCP or UDP checksums.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值