mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
401c6a95a7
* core: Add 'UserAgentString' helper function to generate a standard UserAgent string. Example generation: 'Terraform 0.9.7-dev (go1.8.1)' * provider/openstack: Add Terraform version to UserAgent string
15 lines
264 B
Go
15 lines
264 B
Go
package terraform
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
)
|
|
|
|
// The standard Terraform User-Agent format
|
|
const UserAgent = "Terraform %s (%s)"
|
|
|
|
// Generate a UserAgent string
|
|
func UserAgentString() string {
|
|
return fmt.Sprintf(UserAgent, VersionString(), runtime.Version())
|
|
}
|