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

go run repeatedly reports dependency find when run out of GOPATH with modules on #34828

Closed
ucirello opened this issue Oct 10, 2019 · 2 comments
Closed

Comments

@ucirello
Copy link
Contributor

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

$ go version
go version go1.13.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/TheUser/Library/Caches/go-build"
GOENV="/Users/TheUser/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/TheUser/src/strongdm"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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/_l/9yb78fmx0jzb8khycvrzw3qw0000gn/T/go-build257911427=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Tried to run this piece of code out of the GOPATH with GO111MODULE=on

main.go
$ cat main.go
package main

import (
"github.com/chzyer/readline"
)

func main() {
_ = readline.New
}

What did you expect to see?

$ go run main.go
$

What did you see instead?

$ go run main.go
go: finding github.com/chzyer/readline latest
$

A couple of extra facts:

  1. It doesn't happen with github.com/davecgh/go-spew/spew
  2. It does happen with github.com/chzyer/readline
  3. It does report the download efforts after go clean -modcache
@bcmills
Copy link
Contributor

bcmills commented Oct 10, 2019

This interaction is at the intersection of #32027 and #33284.

#32027 will address it (in 1.14) by making the unresolved import an explicit error, instead of trying to resolve it.

The difference between github.com/chzyer/readline and github.com/davecgh/go-spew/spew is that the latter has explicit tags, and the finding message happens to only occur on the path that downloads a branch.

#33284 would make the two modules consistent by always logging the dependency change for both.

@bcmills
Copy link
Contributor

bcmills commented Oct 10, 2019

Duplicate of #32027

@bcmills bcmills marked this as a duplicate of #32027 Oct 10, 2019
@bcmills bcmills closed this as completed Oct 10, 2019
@golang golang locked and limited conversation to collaborators Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants