gpt4 book ai didi

windows - 如何在 gometalinter 中禁用 pkcs11?

转载 作者:数据小太阳 更新时间:2023-10-29 03:24:01 24 4
gpt4 key购买 nike

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

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/

24 4 0
文章推荐: maven - 如何从 go lang 代码运行 maven 构建
文章推荐: jquery - 遍历