yvbolt/versions.go

26 lines
359 B
Go
Raw Normal View History

2024-06-27 23:01:34 +00:00
package main
import (
"runtime/debug"
2024-06-27 23:01:34 +00:00
)
var (
version_Pebble string
)
func init() {
// ReadBuildInfo still works even with `-ldflags '-s -w'`.
mm, ok := debug.ReadBuildInfo()
if !ok {
panic("Missing build info")
2024-06-27 23:01:34 +00:00
}
for _, dep := range mm.Deps {
switch dep.Path {
2024-06-27 23:01:34 +00:00
case "github.com/cockroachdb/pebble":
version_Pebble = dep.Version
2024-06-27 23:01:34 +00:00
}
}
}