error-pages/internal/appmeta/version.go

18 lines
348 B
Go
Raw Permalink Normal View History

2024-07-03 14:12:13 +00:00
package appmeta
2021-09-29 15:38:50 +00:00
import "strings"
// version value will be set during compilation.
var version = "v0.0.0@undefined"
// Version returns version value (without `v` prefix).
func Version() string {
2024-07-03 14:12:13 +00:00
var v = strings.TrimSpace(version)
2021-09-29 15:38:50 +00:00
if len(v) > 1 && ((v[0] == 'v' || v[0] == 'V') && (v[1] >= '0' && v[1] <= '9')) {
return v[1:]
}
return v
}