Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LibPath, LibVersion string = func() (string, string) {
pkg := reflect.TypeFor[marker]().PkgPath()
info, ok := debug.ReadBuildInfo()
if !ok {
return pkg, "dev"
}
best, version := "", "dev"
check := func(m *debug.Module) {
if m == nil || m.Path == "" {
return
}
if (pkg == m.Path || strings.HasPrefix(pkg, m.Path+"/")) && len(m.Path) > len(best) {
best, version = m.Path, m.Version
if m.Replace != nil && m.Replace.Version != "" {
version = m.Replace.Version
}
}
}
check(&info.Main)
for _, dep := range info.Deps {
check(dep)
}
if best == "" {
best = pkg
}
if version == "" || version == "(devel)" {
version = "dev"
}
return best, version
}()
Functions ¶
func SanitizeName ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.