...
1
2cd a
3! go build
4stderr '^ambiguous import: found package image in multiple modules:\s+image\s+.+\s.+image.+\s$'
5
6
7cd ../b
8! go build -mod=vendor
9stderr '^main.go:4:5: ambiguous import: found package image in multiple directories:\s+.+image\s+.+image\s+$'
10
11cd ../c
12! go build -mod=vendor
13stderr 'main.go:4:5: package p is not in std'
14
15-- a/go.mod --
16module image
17
18-- a/main.go --
19package main
20
21func main() {
22 println("hello world!")
23}
24
25-- b/go.mod --
26module test
27
28-- b/vendor/image/b.go --
29package image
30func Add(a, b int) int {
31 return a + b
32}
33
34-- b/main.go --
35package main
36
37import (
38 "image"
39)
40
41func main() {
42 println(image.Add(1,1))
43}
44
45-- c/go.mod --
46module test
47
48-- c/main.go --
49package main
50
51import (
52 "p"
53)
54
55func main() {
56 println(p.Add(1,1))
57}
View as plain text