It is more strange that, if I replace the go101.org appearances with
"aaa.bbb", a non-existing domain.
// main.go
package main
import (
_ "aaa.bbb/tinyrouter"
)
func main() {
}
// go.mod
module app
replace aaa.bbb/tinyrouter => github.com/go101/tinyrouter v1.0.0
then run "go build -x -v" again, it still connects to go101.org.
But now the project should be unrelated to go101.org totally.
Did I do anything wrong?
$ go build -x -v
WORK=/tmp/go-build893093914
Fetching https://go101.org/tinyrouter?go-get=1
Fetching https://aaa.bbb/tinyrouter?go-get=1
https fetch failed: Get https://aaa.bbb/tinyrouter?go-get=1: dial tcp:
lookup aaa.bbb on 8.8.8.8:53: no such host
Fetching https://aaa.bbb?go-get=1
https fetch failed: Get https://aaa.bbb?go-get=1: dial tcp: lookup aaa.bbb
on 8.8.8.8:53: no such host
Parsing meta tags from https://go101.org/tinyrouter?go-get=1 (status code
404)
Fetching https://go101.org?go-get=1
Parsing meta tags from https://go101.org?go-get=1 (status code 200)
build app: cannot find module for path aaa.bbb/tinyrouter
On Saturday, November 10, 2018 at 4:54:50 AM UTC-4, T L wrote:
>
> I host a package on github: https://github.com/go101/tinyrouter
> And I decided to use "go101.org/tinyrouter" as its import path.
>
> Then in a program which import the package:
>
> // main.go
> package main
>
> import (
> _ "go101.org/tinyrouter"
> )
>
> func main() {
> }
>
> // go.mod
> module app
>
> replace go101.org/tinyrouter => github.com/go101/tinyrouter v1.0.0
>
> When I build it, it reports errors:
>
> $ go build -v -x
> WORK=/tmp/go-build304435862
> Fetching https://go101.org/tinyrouter?go-get=1
> Parsing meta tags from https://go101.org/tinyrouter?go-get=1 (status code
> 404)
> Fetching https://go101.org?go-get=1
> Parsing meta tags from https://go101.org?go-get=1 (status code 200)
> build a.b/app: cannot find module for path go101.org/tinyrouter
>
> The go command still connect to https://go101.org?
> Shouldn't it connect github.com instead?
>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.