github.com/ves/terraform@v0.8.0-beta2/terraform/version.go (about) 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. 10 const Version = "0.8.0" 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. 15 const VersionPrerelease = "beta2" 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 }