| 1 |
cp go.mod go.mod.orig |
| 2 |
go mod tidy |
| 3 |
cmp go.mod go.mod.orig |
| 4 |
|
| 5 |
-- go.mod -- |
| 6 |
module example.com/tidy |
| 7 |
|
| 8 |
go 1.16 |
| 9 |
|
| 10 |
require ( |
| 11 |
example.net/incomplete v0.1.0 |
| 12 |
example.net/indirect v0.2.0 // indirect |
| 13 |
example.net/toolow v0.1.0 |
| 14 |
) |
| 15 |
|
| 16 |
replace ( |
| 17 |
example.net/incomplete v0.1.0 => ./incomplete |
| 18 |
example.net/indirect v0.1.0 => ./indirect.1 |
| 19 |
example.net/indirect v0.2.0 => ./indirect.2 |
| 20 |
example.net/toolow v0.1.0 => ./toolow |
| 21 |
) |
| 22 |
-- tidy.go -- |
| 23 |
package tidy |
| 24 |
|
| 25 |
import ( |
| 26 |
_ "example.net/incomplete" |
| 27 |
_ "example.net/toolow" |
| 28 |
) |
| 29 |
|
| 30 |
-- incomplete/go.mod -- |
| 31 |
module example.net/incomplete |
| 32 |
|
| 33 |
go 1.16 |
| 34 |
|
| 35 |
// This module omits a needed requirement on example.net/indirect. |
| 36 |
-- incomplete/incomplete.go -- |
| 37 |
package incomplete |
| 38 |
|
| 39 |
import _ "example.net/indirect/newpkg" |
| 40 |
|
| 41 |
-- toolow/go.mod -- |
| 42 |
module example.net/toolow |
| 43 |
|
| 44 |
go 1.16 |
| 45 |
|
| 46 |
require example.net/indirect v0.1.0 |
| 47 |
-- toolow/toolow.go -- |
| 48 |
package toolow |
| 49 |
|
| 50 |
import _ "example.net/indirect/oldpkg" |
| 51 |
|
| 52 |
-- indirect.1/go.mod -- |
| 53 |
module example.net/indirect |
| 54 |
|
| 55 |
go 1.16 |
| 56 |
-- indirect.1/oldpkg/oldpkg.go -- |
| 57 |
package oldpkg |
| 58 |
|
| 59 |
|
| 60 |
-- indirect.2/go.mod -- |
| 61 |
module example.net/indirect |
| 62 |
|
| 63 |
go 1.16 |
| 64 |
-- indirect.2/oldpkg/oldpkg.go -- |
| 65 |
package oldpkg |
| 66 |
-- indirect.2/newpkg/newpkg.go -- |
| 67 |
package newpkg |