我试图通过在gopath中克隆存储库并运行make来构建coredns https://github.com/coredns/coredns/,这会产生以下错误
GO111MODULE=on go generate coredns.go
GO111MODULE=on CGO_ENABLED=0 go build -v -ldflags="-s -w -X github.com/coredns/coredns/coremain.GitCommit=f6eb2a4" -o coredns
../../../../pkg/mod/google.golang.org/grpc@v1.19.0/internal/channelz/types_linux.go:26:2:
../../../../pkg/mod/golang.org/x/sys@v0.0.0-20190215142949-d0b11bdaac8a/unix/affinity_linux.go:1:1: expected 'package', found 'EOF'
Makefile:17: recipe for target 'coredns' failed
make: *** [coredns] Error 1
我运行了go mod tidy
,它修复了由于x/sys
而引起的错误,但此后又出现了另一个错误
# github.com/miekg/dns
Dev/Projects/golang/gopath/pkg/mod/github.com/miekg/dns@v1.1.6/scan.go:436:29: string not terminated
Dev/Projects/golang/gopath/pkg/mod/github.com/miekg/dns@v1.1.6/scan.go:436:44: syntax error: unexpected EOF, expecting comma or )
当我尝试获取该软件包时,我遇到了相同的错误,我的gopath中没有此软件包,缓存目录中也没有它。
这里似乎是什么问题?