github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/mod/example.com_printversion_v0.1.0.txt (about) 1 example.com/printversion v0.1.0 2 3 -- .mod -- 4 module example.com/printversion 5 -- .info -- 6 {"Version":"v0.1.0"} 7 -- README.txt -- 8 There is no go.mod file for this version of the module. 9 -- printversion.go -- 10 package main 11 12 import ( 13 "fmt" 14 "os" 15 "runtime/debug" 16 17 _ "example.com/version" 18 ) 19 20 func main() { 21 info, _ := debug.ReadBuildInfo() 22 fmt.Fprintf(os.Stdout, "path is %s\n", info.Path) 23 fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version) 24 for _, m := range info.Deps { 25 fmt.Fprintf(os.Stdout, "using %s %s\n", m.Path, m.Version) 26 } 27 }