Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: unhelpful error message from "go build" in new module #31475

Closed
jayconrod opened this Issue Apr 15, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@jayconrod
Copy link
Contributor

commented Apr 15, 2019

What version of Go are you using (go version)?

go version devel +68c664141c Tue Apr 9 18:57:21 2019 +0000 darwin/amd64

Does this issue reproduce with the latest release?

n/a

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jayconrod/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/jayconrod/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/jayconrod/Code/go"
GOTMPDIR=""
GOTOOLDIR="/Users/jayconrod/Code/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jayconrod/Code/test/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rq/x0692kqj6ml8cvrhcqh5bswc008xj1/T/go-build980990898=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go mod init m
cat >repro.go <<EOF
package main

import (
        "github.com/docker/docker/api/server/httputils"
        "log"
        "net/http"
)

func main() {
        req, err := http.NewRequest("GET", "http://localhost:12345", nil)
        if err != nil {
                log.Fatal(err)
        }
        if err = httputils.CheckForJSON(req); err != nil {
                log.Fatal(err)
        }
}
EOF
go build .

What did you expect to see?

A chain of module requirements or package imports that indicates why github.com/sirupsen/logrus is required with the wrong module path.

What did you see instead?

go: finding github.com/docker/docker/api/server/httputils latest
go: finding github.com/docker/docker/api/server latest
go: finding github.com/docker/docker/api latest
go: finding github.com/docker/libtrust latest
go: finding github.com/docker/go-connections/nat latest
go: finding golang.org/x/net/context latest
go: finding golang.org/x/net latest
go: downloading golang.org/x/net v0.0.0-20190415100556-4a65cf94b679
go: extracting golang.org/x/net v0.0.0-20190415100556-4a65cf94b679
go: github.com/Sirupsen/logrus@v1.4.1: parsing go.mod: unexpected module path "github.com/sirupsen/logrus"

@jayconrod jayconrod added this to the Go1.13 milestone Apr 15, 2019

@jayconrod jayconrod self-assigned this Apr 15, 2019

@jayconrod

This comment has been minimized.

Copy link
Contributor Author

commented Apr 15, 2019

@gopherbot

This comment has been minimized.

Copy link

commented Apr 15, 2019

Change https://golang.org/cl/171859 mentions this issue: cmd/go: print package import chains for some build list errors

@gopherbot gopherbot closed this in 2bdbc94 Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.