2024-06-27 23:01:34 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-06-27 23:05:49 +00:00
|
|
|
"runtime/debug"
|
2024-06-27 23:01:34 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
version_Pebble string
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
2024-06-27 23:05:49 +00:00
|
|
|
// 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
|
|
|
}
|
|
|
|
|
2024-06-27 23:05:49 +00:00
|
|
|
for _, dep := range mm.Deps {
|
|
|
|
switch dep.Path {
|
2024-06-27 23:01:34 +00:00
|
|
|
case "github.com/cockroachdb/pebble":
|
2024-06-27 23:05:49 +00:00
|
|
|
version_Pebble = dep.Version
|
2024-06-27 23:01:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|