在进行单元测试或构建我的代码时,我必须使用以下命令:go test --tags nopkcs11
我正在 Windows 上使用https://github.com/alecthomas/gometalinter进行棉绒整理。
gometalinter运作良好,但是每当运行linting时,我都会看到大量(数百)条消息,如下所示:c:\Users\xxxxxxxxx\workspace\go\src\github.com\hyperledger\fabric\bccsp\pkcs11\impl.go:70:24:warning: SessionHandle not declared by package pkcs11 (staticcheck)c:\Users\xxxxxxxxx\workspace\go\src\github.com\hyperledger\fabric\bccsp\pkcs11\impl.go:70:24:warning: SessionHandle not declared by package 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/