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 1.11 inappropriately trying to http fetch local repository #27869

Closed
bjm88 opened this issue Sep 25, 2018 · 2 comments
Closed

Go 1.11 inappropriately trying to http fetch local repository #27869

bjm88 opened this issue Sep 25, 2018 · 2 comments

Comments

@bjm88
Copy link

bjm88 commented Sep 25, 2018

Moving from Go 1.10 to go 1.11 I setup a go.mod which references cached/downloaded 3rd part libs like normal, but I also reference a shared common lib within our codebase. We have monolithic repo setup so 3 projects

./workspace/
  ./identity_service
 ./chat_service
 ./api_service
 ./common_lib  (other 3 go modules reference this locally)

Example go.mod

module company.com/project1/identity_service

require (
	cloud.google.com/go v0.28.0 // standard 3rd party lib
        company.com/project1/common_lib v0.0.0 . //local lib
)

replace company.com/project1/go_common => ../go_common

Go build works, but is slow. Doing go run with -v reveals the issue, its trying to actually call company.com with go get and timing out and then continues without issue. Is there a better way to set this up in go.mod so it understands to only get it locally ?

go run -v main.go
Fetching https://company.com/project1/go_common?go-get=1
https fetch failed: Get https://mountsinai.org/consumer/go_common?go-get=1: dial tcp 146.203.125.245:443: connect: connection refused

go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ben/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ben/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/8_/b0g1vb392ws98pthb2vcf5nr0000gn/T/go-build903710899=/tmp/go-build -gno-record-gcc-switches -fno-common"

@bradfitz
Copy link
Contributor

/cc @bcmills

@bcmills
Copy link
Contributor

bcmills commented Sep 26, 2018

Almost certainly the same underlying cause as #27859.

@bcmills bcmills closed this as completed Sep 26, 2018
@golang golang locked and limited conversation to collaborators Sep 26, 2019
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

4 participants