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: go mod does support directory packages #28716

Closed
clearcodecn opened this issue Nov 10, 2018 · 4 comments
Closed

cmd/go: go mod does support directory packages #28716

clearcodecn opened this issue Nov 10, 2018 · 4 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@clearcodecn
Copy link

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

$ go version
go version go1.11 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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mrj/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mrj/Desktop/vendor"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/mrj/Desktop/echo-basic/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/4v/knjv8mkn7931qlfdfc7s3v140000gn/T/go-build634382221=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I want to replace the pkg: golang.org/x/crypto/acme/autocert to github.com/golang/crypto/acme/autocert

this is my go.mod file

replace golang.org/x/crypto/acme/autocert => github.com/golang/crypto/acme/autocert v0.0.0-20181106171534-e4dc69e5b2fd

but It was wrong!

➜  server go run -v root.go 
Fetching https://golang.org/x/crypto/acme/autocert?go-get=1
^C
➜  server go run -v main.go
Fetching https://golang.org/x/crypto/acme/autocert?go-get=1
https fetch failed: Get https://golang.org/x/crypto/acme/autocert?go-get=1: dial tcp 216.239.37.1:443: i/o timeout
Fetching https://golang.org/x/crypto/acme?go-get=1
https fetch failed: Get https://golang.org/x/crypto/acme?go-get=1: dial tcp 216.239.37.1:443: i/o timeout
Fetching https://golang.org/x/crypto?go-get=1

it doest replace golang.orgtogithub.com`

What did you expect to see?

I want to see download from github.com

What did you see instead?

https fetch failed: Get https://golang.org/x?go-get=1: dial tcp 216.239.37.1:443: i/o timeout
Fetching https://golang.org?go-get=1

How should I write the go.mod file correct ?

@myitcv
Copy link
Member

myitcv commented Nov 10, 2018

(from phone) just out of interest why do you need to apply this replace? I'm assuming it's because the original import path is inaccessible or blocked from your location?

@ianlancetaylor ianlancetaylor changed the title go mod does support directory packages cmd/go: go mod does support directory packages Nov 10, 2018
@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. modules labels Nov 10, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Nov 10, 2018
@ianlancetaylor
Copy link
Contributor

CC @bcmills

@clearcodecn
Copy link
Author

@myitcv Yeah. Im in china , golang.org was blocked ! Im use github.com/labstack/echo depends on golang.org/x/crypto/acme/autocert
see here

so I want to replace golang.org/x/crypto/acme/autocert to github.com/golang/crypto/acme/autocert

but the go-get fetch from https://github.com/golang/crypto/acme/autocert is not a vcs .

how can I make the correct replace in my go.mod

@myitcv
Copy link
Member

myitcv commented Nov 11, 2018

Thanks for confirming @clearcodecn. This is, in effect, a duplicate of #28652. So I'll close this and we can continue conversation there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants