summaryrefslogtreecommitdiff
path: root/internal/meta/meta.go
blob: 0c5a05560f67c90af83dd8f6fe22e093db9579a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package meta

import "strings"

// next variables will be set during compilation (do NOT rename them).
var (
	version   = "local"
	buildTime = "development" //nolint:gochecknoglobals
)

// Version returns version value (without `v` prefix).
func Version() string {
	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
}

// BuildTime returns application building time.
func BuildTime() string { return buildTime }