2017-02-07 21:33:23 +00:00
|
|
|
package autorest
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2017-04-07 09:53:39 +00:00
|
|
|
"strings"
|
|
|
|
"sync"
|
2017-02-07 21:33:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2017-04-07 09:53:39 +00:00
|
|
|
major = 7
|
|
|
|
minor = 3
|
|
|
|
patch = 1
|
|
|
|
tag = ""
|
2017-02-07 21:33:23 +00:00
|
|
|
)
|
|
|
|
|
2017-04-07 09:53:39 +00:00
|
|
|
var versionLock sync.Once
|
|
|
|
var version string
|
|
|
|
|
2017-02-07 21:33:23 +00:00
|
|
|
// Version returns the semantic version (see http://semver.org).
|
|
|
|
func Version() string {
|
2017-04-07 09:53:39 +00:00
|
|
|
versionLock.Do(func() {
|
|
|
|
version = fmt.Sprintf("v%d.%d.%d", major, minor, patch)
|
|
|
|
|
|
|
|
if trimmed := strings.TrimPrefix(tag, "-"); trimmed != "" {
|
|
|
|
version = fmt.Sprintf("%s-%s", version, trimmed)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
return version
|
2017-02-07 21:33:23 +00:00
|
|
|
}
|