简体   繁体   English

无法安装 golint 包:错误的导入路径

[英]Cannot install golint package: wrong import path

I have a project that uses golint and installs it inside the docker container.我有一个使用 golint 并将其安装在 docker 容器内的项目。 It have been working ok for months (and have been built multiple times), but today when I build the container again I get the following error: go get -u github.com/golang/lint/golint它已经运行了几个月(并且已经构建了多次),但是今天当我再次构建容器时出现以下错误: go get -u github.com/golang/lint/golint

package github.com/golang/lint/golint: 
code in directory /a-go-path/golang/lint/golint expects import "golang.org/x/lint/golint"

I can replicate the issue locally on my computer by typing go get github.com/golang/lint/golint.我可以通过键入 go get github.com/golang/lint/golint 在我的计算机上本地复制该问题。 I have deleted all the packages related to golint in the go path (source and bin folders), still when I try to install it again I get the former error.我已经删除了 go 路径(源和 bin 文件夹)中与 golint 相关的所有包,但当我再次尝试安装它时,我仍然收到以前的错误。 I am using go 1.11.0 Any recommendations?我正在使用 go 1.11.0 有什么建议吗?

You are supposed to use go get -u golang.org/x/lint/golint to install golint .应该使用go get -u golang.org/x/lint/golint golint来安装golint Note that this is exactly the URL in the error message.请注意,这正是错误消息中的 URL。

You'll need to modify the image you use to build the container to use this URL.您需要修改用于构建容器的图像以使用此 URL。

It started to happen yesterday due to this commit (they added golang.org/x/lint/golint as the import path).由于这次提交,它昨天开始发生(他们添加了golang.org/x/lint/golint作为导入路径)。 See this issue for more information.有关更多信息,请参阅问题。

go get -u golang.org/x/lint/golint

它已经更新到这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 程序包X无法识别的导入路径:导入路径不是以主机名开头 - package X unrecognized import path : import path does not begin with hostname Docker golang包导入错误:导入路径不以hostname开头 - Docker golang package import error : import path does not begin with hostname 无法通过docker-compose安装Python软件包 - Cannot install Python Package with docker-compose 无法在docker镜像中安装RWeka软件包 - Cannot install RWeka package in docker image 无法在已安装的目录中安装npm软件包 - Cannot install npm package in a mounted directory 无法使用Docker Compose安装软件包 - Cannot install package using docker compose 在Docker构建中为自己的包转到1.11未知的导入路径 - Go 1.11 unknown import path for own package in Docker build 使用本地程序包构建docker时,错误'导入路径不以hostname'开头 - Error 'import path does not begin with hostname' when building docker with local package 无法在 Dockerfile 中安装软件包 [E: 子进程 /usr/bin/dpkg 返回错误代码 (1)] - Cannot install package inside Dockerfile [E: Sub-process /usr/bin/dpkg returned an error code (1)] Docker for Windows 尝试在本地安装 Shopware 6 时“系统找不到指定的路径” - Docker for Windows "The system cannot find the path specified" when trying to install Shopware 6 locally
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM