github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/mod/example.com_printversion_v1.0.0.txt (about) 1 example.com/printversion v1.0.0 2 3 -- .mod -- 4 module example.com/printversion 5 6 require example.com/version v1.0.0 7 replace example.com/version v1.0.0 => ../oops v0.0.0 8 exclude example.com/version v1.1.0 9 -- .info -- 10 {"Version":"v1.0.0"} 11 -- go.mod -- 12 module example.com/printversion 13 14 require example.com/version v1.0.0 15 replace example.com/version v1.0.0 => ../oops v0.0.0 16 exclude example.com/version v1.0.1 17 -- printversion.go -- 18 package main 19 20 import ( 21 "fmt" 22 "os" 23 "runtime/debug" 24 25 _ "example.com/version" 26 ) 27 28 func main() { 29 info, _ := debug.ReadBuildInfo() 30 fmt.Fprintf(os.Stdout, "path is %s\n", info.Path) 31 fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version) 32 for _, m := range info.Deps { 33 fmt.Fprintf(os.Stdout, "using %s %s\n", m.Path, m.Version) 34 } 35 }