使用MacBook Pro,Big操作系统,我遵循了超级分类系统结构文档,我安装了所有所需的文件和工具。但是,当我到达最后一步时,代码会生成一个goimport错误,无法修复。错误如下:
johnny@JohnnyMBP fabric % make basic-checks integration-test-prereqs
All files are excluded from having license headers
Building github.com/client9/misspell/cmd/misspell -> misspell
Checking changed go files for spelling errors ...
spell checker passed
Checking for go:generate parent path references
Checking trailing spaces ...
DEP: Checking for dependency issues..
./scripts/check_deps.sh
Building golang.org/x/tools/cmd/goimports -> goimports
Building mvdan.cc/gofumpt -> gofumpt
Building honnef.co/go/tools/cmd/staticcheck -> staticcheck
LINT: Running code checks..
./scripts/golinter.sh
Checking with goimports
The following files contain goimports errors
bccsp/factory/nopkcs11.go
bccsp/factory/nopkcs11_test.go
bccsp/factory/pkcs11.go
bccsp/factory/pkcs11_test.go
bccsp/factory/pkcs11factory.go
bccsp/factory/pkcs11factory_test.go
bccsp/pkcs11/pkcs11_test.go
core/handlers/library/noplugin_test.go
core/handlers/library/plugin.go
core/handlers/library/plugin_stub.go
core/handlers/library/race_test.go
integration/ledger/ledger_generate_test.go
internal/fileutil/syncdir.go
internal/peer/node/signals.go
internal/peer/node/signals_windows.go
orderer/common/server/signals.go
orderer/common/server/signals_windows.go
The goimports command 'goimports -l -w' must be run for these files
make: *** [linter] Error 1
johnny@JohnnyMBP fabric % 这是我的围棋环境结果:
johnny@JohnnyMBP fabric % go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/johnny/Library/Caches/go-build"
GOENV="/Users/johnny/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/johnny/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/johnny/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.17.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.17.2/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/johnny/github.com/webzest/fabric/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/vs/8twtz6352nb26pnpyqfk11j80000gn/T/go-build698966046=/tmp/go-build -gno-record-gcc-switches -fno-common"请提供一些指导,我可以遵循,以完成开发环境的超级分类账织物。
更新:
我在所有的-l文件上运行goimports -w并重新运行。现在,我收到了一个供应商错误:
johnny@JohnnyMBP fabric % make basic-checks
All files have SPDX-License-Identifier headers
Building github.com/client9/misspell/cmd/misspell -> misspell
Checking changed go files for spelling errors ...
spell checker passed
Checking for go:generate parent path references
Checking trailing spaces ...
DEP: Checking for dependency issues..
./scripts/check_deps.sh
Building golang.org/x/tools/cmd/goimports -> goimports
Building mvdan.cc/gofumpt -> gofumpt
Building honnef.co/go/tools/cmd/staticcheck -> staticcheck
LINT: Running code checks..
./scripts/golinter.sh
Checking with goimports
Checking with gofumpt
Checking for golang.org/x/net/context
Checking for github.com/gogo/protobuf
Checking with go vet
Checking with staticcheck
The following staticcheck issues were flagged
vendor/github.com/dustin/go-humanize/number.go:76:9: constant overflow (compile)
vendor/github.com/onsi/ginkgo/internal/leafnodes/benchmarker.go:82:25: constant overflow (compile)
make: *** [linter] Error 1
johnny@JohnnyMBP fabric % 是否有人成功地使用最新版本的GO和最新的用于织物的GIT构建来设置开发环境?我需要帮助,拜托?
发布于 2021-10-28 09:34:19
有两件事值得尝试:
如果这些文件中的导入确实有问题,除非它们在本地被修改,否则不应该有问题,那么对列出的每个文件使用goimports -l -w命令来更正它们。
作为参考,我还使用了Macbook Pro,运行MacOS蒙特雷,但以前使用的是Big,而make basic-checks在最新的主分支代码上使用Go 1.16.9为我运行。
https://stackoverflow.com/questions/69746509
复制相似问题