- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在Golang项目中做了一些改动,后来跑了make test
它负责 linting、格式化和单元测试。但是当它运行 linter.sh 时,它会抛出以下错误
pkg/skaffold/kubernetes/wait.go:23: File is not `goimports`-ed with -local github.com/GoogleContainerTools/skaffold (goimports)
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/kubectl"
最佳答案
正常做Sort imports
可能不会工作。我想你有 goimports
用 local-prefixes
掉毛已启用,这就是错误 File is not 'goimports'-ed with -local ...
的原因
通常 goimports
以某种方式对导入的库进行排序,以便标准 pkg 和其他库位于一个单独的组中。但是,当您启用本地前缀时,linting 需要标准 pkg、第 3 方 pkg 和具有指定本地前缀的 pkg(在您的情况下 github.com/GoogleContainerTools/skaffold
,又名您自己的项目 pkg),这 3 种类型在不同的组中。 (引用: https://github.com/golangci/golangci-lint/issues/209 )
import (
// stdlib
// third-party
// other packages of that project
)
These doesn't have to be in 3 groups, you can have more that 3 groups. Just make sure that above 3 types (or 2) are not in the same one.
goimports
确保使用
-local
运行它旗帜。我认为您也可以配置您的 IDE 来做到这一点。在你的情况下,它应该是这样的:
goimports -local "github.com/GoogleContainerTools/skaffold" -w .
-w flag so that it writes the changes back
. (dot) for all the files or you can specify just one file
关于go - 文件不是 `goimports` -ed with -local somePath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59960394/
在这种情况下会弹出此警告: 开始调试 (F5) C++ 程序 调试时编辑一些代码(例如程序遇到断点然后暂停)[#] 停止调试 (Shift+F5) 程序 再次开始调试 (F5) [*] -> WARN
我在我的 Visual Studio 中遇到了这种异常行为,我的测试二进制文件 (mytestsolution.dll) 和在引用中添加的依赖二进制文件突然从我的 Bin 文件夹中复制到 TestRe
当我尝试查询数据时出现以下错误 错误 [nested] 路径 [existing_contacts] 下的嵌套对象不是嵌套类型 索引中的数据 { "_index" : "memorea
我有一个 nextjs webapp。 我希望主应用程序在索引路由上运行:...mydomain.com/ . 但我也想在路线上有一个登陆页面:...mydomain.com/mylandingpag
我在Golang项目中做了一些改动,后来跑了make test它负责 linting、格式化和单元测试。但是当它运行 linter.sh 时,它会抛出以下错误 pkg/skaffold/kuberne
通过反复试验,我发现 stat "$somepath"--format '%F' 可以返回以下值: 常规文件 目录 符号链接(symbolic link) 我希望使用 stat 执行递归目录内容操作,
当我构建时,我发现我收到有关丢失 cod 文件的错误。编译器似乎试图链接到一个在构建输出 .cod 文件时设置了一些标志的库。 我不明白为什么需要 cod 文件来链接,lib 不应该足够吗? 谢谢 最
在我当前的项目中,我在将 Entity Framework 6 连接到我们的生产 Oracle 数据库时遇到了一些问题。 我现在所采取的步骤: 安装了支持 Entity Framework 6 的最新
我最近将我的 UIWebview 替换为我的混合应用程序中的 WKWebview。我正在使用自定义方案从应用程序的 native 部分加载图像,正如 Apple 在此处推荐的那样: https://d
我有一个 SpringBoot 应用程序,其中我在项目之外有 application.properties 文件(它不在通常的位置 src/main/resources 中)。 使用 gradle c
我是一名优秀的程序员,十分优秀!