go - 在 Ubuntu 16.04 中出现 GOPATH 错误“go: cannot use path@version syntax in GOPATH mode”
问题描述
我无法go get git@github<user/repo>
在我的$GOPATH
文件夹中运行。收到此错误:
go: 不能在 GOPATH 模式下使用 path@version 语法
我只是想了解为什么go get
即使$GOPATH
在安装过程中进行了配置也无法正常工作。环境是ubuntu。
~/$ echo $GOPATH
/home/user/go
解决方案
I had the same issue and solved setting specific env variable export GO111MODULE=on
in my .zshrc(or .bashrc depending on which shell you use) and restart the shell in order to enable modules. You can find more details here: https://github.com/golang/go/wiki/Modules
推荐阅读
- c++ - C++ 模板可避免长切换,同时调用具有不同返回类型的函数
- firebase - 找不到类 'Firebase\Jwt\Jwt' YII2
- laravel - Laravel Passport 对密码 grant_type 的无效授权
- javascript - 通过 getElementById() 与 var speed 选择元素
- c# - 使用 JSInterop 在 blazor 中渲染 SVG 元素
- java - Java Flight Recorder - 如何提取自定义事件字段的值?
- xml - XSL:在给定之间包装内容
在
- android - 通过热点传输文件
- java - 与 Payara 4 一起使用的 log4j 2 不会创建日志
- symfony - API 平台响应上的聚合值