]>
Commit | Line | Data |
---|---|---|
bae9f6d2 JC |
1 | package terraform |
2 | ||
3 | import ( | |
4 | "fmt" | |
5 | ||
6 | "github.com/hashicorp/go-version" | |
7 | ) | |
8 | ||
9 | // The main version number that is being run at the moment. | |
c680a8e1 | 10 | const Version = "0.10.0" |
bae9f6d2 JC |
11 | |
12 | // A pre-release marker for the version. If this is "" (empty string) | |
13 | // then it means that it is a final release. Otherwise, this is a pre-release | |
14 | // such as "dev" (in development), "beta", "rc1", etc. | |
c680a8e1 | 15 | var VersionPrerelease = "dev" |
bae9f6d2 JC |
16 | |
17 | // SemVersion is an instance of version.Version. This has the secondary | |
18 | // benefit of verifying during tests and init time that our version is a | |
19 | // proper semantic version, which should always be the case. | |
20 | var SemVersion = version.Must(version.NewVersion(Version)) | |
21 | ||
22 | // VersionHeader is the header name used to send the current terraform version | |
23 | // in http requests. | |
24 | const VersionHeader = "Terraform-Version" | |
25 | ||
26 | func VersionString() string { | |
27 | if VersionPrerelease != "" { | |
28 | return fmt.Sprintf("%s-%s", Version, VersionPrerelease) | |
29 | } | |
30 | return Version | |
31 | } |