mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
18 lines
348 B
Go
18 lines
348 B
Go
package appmeta
|
|
|
|
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 {
|
|
var v = strings.TrimSpace(version)
|
|
|
|
if len(v) > 1 && ((v[0] == 'v' || v[0] == 'V') && (v[1] >= '0' && v[1] <= '9')) {
|
|
return v[1:]
|
|
}
|
|
|
|
return v
|
|
}
|