Bump all vendoring (#1612)
Update all vendoring to current releases. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
14df2a1a1a
commit
1567cefdae
511 changed files with 98653 additions and 38115 deletions
46
vendor/honnef.co/go/tools/version/buildinfo.go
vendored
Normal file
46
vendor/honnef.co/go/tools/version/buildinfo.go
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// +build go1.12
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
)
|
||||
|
||||
func printBuildInfo() {
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
fmt.Println("Main module:")
|
||||
printModule(&info.Main)
|
||||
fmt.Println("Dependencies:")
|
||||
for _, dep := range info.Deps {
|
||||
printModule(dep)
|
||||
}
|
||||
} else {
|
||||
fmt.Println("Built without Go modules")
|
||||
}
|
||||
}
|
||||
|
||||
func buildInfoVersion() (string, bool) {
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return "", false
|
||||
}
|
||||
if info.Main.Version == "(devel)" {
|
||||
return "", false
|
||||
}
|
||||
return info.Main.Version, true
|
||||
}
|
||||
|
||||
func printModule(m *debug.Module) {
|
||||
fmt.Printf("\t%s", m.Path)
|
||||
if m.Version != "(devel)" {
|
||||
fmt.Printf("@%s", m.Version)
|
||||
}
|
||||
if m.Sum != "" {
|
||||
fmt.Printf(" (sum: %s)", m.Sum)
|
||||
}
|
||||
if m.Replace != nil {
|
||||
fmt.Printf(" (replace: %s)", m.Replace.Path)
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
Loading…
Reference in a new issue