0

I tried to build coredns https://github.com/coredns/coredns/ by cloning the repo in my gopath and running make, which produced the following error

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

I ran go mod tidy and it fixed the error due x/sys but after that another error appeared

# 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 )

when I tried go get for this package I got the same error, I dont have this package in my gopath neither do I have it in my cache directory.

whats seems to be the problem here?

Palash Nigam
  • 1,653
  • 3
  • 14
  • 26
  • What version of go you use? – Vadim Ashikhman Mar 28 '19 at 19:18
  • I was using 1.11.5 when this occured, then I thought of upgrading go but I still got the same error, currently I am on 1.12 – Palash Nigam Mar 28 '19 at 19:41
  • Do `git reset --hard` and run `make` again with 1.12 version of go. – Vadim Ashikhman Mar 28 '19 at 19:56
  • that just brought back the `x/sys` error again – Palash Nigam Mar 28 '19 at 20:40
  • 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 @VadimAshikhman – Palash Nigam Mar 28 '19 at 20:40
  • Check `$GOPATH/pkg/mod/golang.org/x/sys@v0.0.0-20190215142949-d0b11bdaac8a/unix/affinity_linux.go` file, is it empty? If so try to remove everything in `$GOPATH/pkg` dir and run again, or reinstall go. – Vadim Ashikhman Mar 28 '19 at 20:43

0 Answers0