Skip to content

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

Closed
@ucirello

Description

@ucirello

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions