windows - 如何在 gometalinter 中禁用 pkcs11?

标签 windows go lint

当进行单元测试或构建我的代码时,我必须使用以下命令:

go test --tags nopkcs11

我正在使用 https://github.com/alecthomas/gometalinterwindows 上进行 linting。

gometalinter 运行良好,但每当我运行 linting 时,我都会看到大量(数百条)这样的消息:

c:\Users\xxxxxxxxx\workspace\go\src\github.com\hyperledger\fabric\bccsp\pkcs11\impl.go:70:24:warning: SessionHandle 未由包 pkcs11 声明(staticcheck) c:\Users\xxxxxxxxx\workspace\go\src\github.com\hyperledger\fabric\bccsp\pkcs11\impl.go:70:24:warning: SessionHandle 未由包 pkcs11 声明(staticcheck) c:\Users\xxxxxxxxx\workspace\go\src\github.com\hyperledger\fabric\bccsp\pkcs11\pkcs11.go:39:9:warning: New not declared by package pkcs11 (staticcheck) c:\Users\xxxxxxxxx\workspace\go\src\github.com\hyperledger\fabric\bccsp\pkcs11\pkcs11.go:50:20:warning: cannot range over slots (invalid operand) (staticcheck)

我按以下方式运行 metalinter:

$ gometalinter.v1 ./...

有没有办法在 gometalinter 上禁用 pkcs11

最佳答案

这有点 hack + Windows 用户必须有一个 unix 终端:

gometalinter.v1 ./... --deadline 10000000ms  | awk '!/pkcs11/'

关于windows - 如何在 gometalinter 中禁用 pkcs11?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47181674/

相关文章:

c++ - 如何判断您是否在 Windows 上编译?

go - 需要了解 goroutines

json - 无法将 json 数据反序列化为结构

windows - 如何解决在 Windows 上的 Ubuntu 上更新 polymer-cli 由于 .git : Permission denied 而失败

windows - 如何使用 Write-EventLog 在事件日志中显示任务类别的字符串名称?

c# - 在所有类型的文件上写入文件扩展属性 "Revision Number"

golang 下载文件而不是 html 页面

android - 为什么我在 android studio 中没有看到硬编码文本的任何 lint 错误

go - 从 lint 问题报告中排除特定文件集

scala - 如何忽略 Scala 中的 "-Ywarn-unused"警告?