You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The go files are just enough to form dependencies c -> b -> a:
a/a.go:
package a
import"fmt"funcDoIt() {
fmt.Printf("Doing it\n")
}
b/b.go:
package b
import"github.com/test/a"funcDoA() {
a.DoIt()
}
c/c.go:
package c
import"github.com/test/b"funcDoB() {
b.DoA()
}
The test files are all empty, just enough to run go test successfully:
a/a_test.go:
package a
import"testing"funcTestNothing(t*testing.T) {
}
... b and c are the same.
The modules have replace statements:
a/go.mod:
module github.com/test/a
go 1.13
b/go.mod:
module github.com/test/b
go 1.13
replace github.com/test/a => ../a
c/go.mod:
module github.com/test/c
go 1.13
replace github.com/test/b => ../b
What did you expect to see?
$ cd a
$ go test
PASS
ok github.com/test/a 0.001s
$ cd ../b
$ go test
PASS
ok github.com/test/b 0.001s
$ cd ../c
$ go test
PASS
ok github.com/test/c 0.001s
What did you see instead?
$ cd a
$ go test
PASS
ok github.com/test/a 0.001s
$ cd ../b
$ go test
PASS
ok github.com/test/b 0.001s
$ cd ../c
$ go test
go: github.com/test/[email protected] requires
github.com/test/[email protected]: invalid version: git fetch -f https://github.com/test/a refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/karl/go/pkg/mod/cache/vcs/c0c8a2e25befe4efbfc70a367829c70c25266a092b79a63d54afae917f3e6b65: exit status 128:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The text was updated successfully, but these errors were encountered:
Exclude and replace apply only in the main module's go.mod and are ignored in dependencies.
If you want to apply both replacements simultaneously, then you need both of those replace directives in the main module's go.mod file. (The “main module” is the module in whose directory the go command was invoked.)
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I created 3 modules in the following directory structure:
The go files are just enough to form dependencies c -> b -> a:
a/a.go:
b/b.go:
c/c.go:
The test files are all empty, just enough to run
go test
successfully:a/a_test.go:
... b and c are the same.
The modules have
replace
statements:a/go.mod:
b/go.mod:
c/go.mod:
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: