1

我将 golangci-lint 添加到我的 makefile 中,出于某种奇怪的原因,它对官方 go-1.13 源代码进行了 linting。这非常令人困惑,我认为这可能与我的 go envs 有关这是错误消息的片段

../../../../usr/share/go-1.13/src/internal/syscall/unix/at_sysnum_linux.go:12:7: AT_REMOVEDIR redeclared in this block (typecheck)
const AT_REMOVEDIR = 0x200
      ^
../../../../usr/share/go-1.13/src/internal/syscall/unix/at_aix.go:12:2: other declaration of AT_REMOVEDIR (typecheck)
        AT_REMOVEDIR        = 0x1
        ^
../../../../usr/share/go-1.13/src/internal/syscall/unix/at_sysnum_linux.go:13:7: AT_SYMLINK_NOFOLLOW redeclared in this block (typecheck)
const AT_SYMLINK_NOFOLLOW = 0x100
      ^
../../../../usr/share/go-1.13/src/internal/syscall/unix/at_aix.go:13:2: other declaration of AT_SYMLINK_NOFOLLOW (typecheck)
        AT_SYMLINK_NOFOLLOW = 0x1
        ^
../../../../usr/share/go-1.13/src/syscall/flock_aix.go:12:6: FcntlFlock redeclared in this block (typecheck)
func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) {
     ^
../../../../usr/share/go-1.13/src/syscall/flock.go:16:6: other declaration of FcntlFlock (typecheck)
func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
     ^

这是我的 go envs 的快照。注意我正在为 linux 1 使用 windows 子系统。

@DESKTOP-BLA:~/go/crypto-purchase-testnet$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/robertcob/.cache/go-build"
GOENV="/home/robertcob/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/robertcob/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/robertcob/go/crypto-purchase-testnet/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build923620797=/tmp/go-build -gno-record-gcc-switches"

我的 go 文件结构的广泛概述如下......我的 golang 源目录是

/home/robertcob/go

里面/去我有

/go/bin

/go/pkg

/go/crypto-purchase-testnet # this is github repo im currently writing the makefile in etc

我非常怀疑我在 go golang 项目路径中犯了错误,不胜感激;)

4

0 回答 0