Documentation
¶
Overview ¶
Package environment provides utility functions for interacting with the OS environment (e.g environment variables).
Deprecated: The environment package is scheduled for removal in Terratest v2. Most uses are os.Getenv with a literal default; call the standard library directly instead. See the Terratest v2 migration notes for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFirstNonEmptyEnvVarOrEmptyString
deprecated
GetFirstNonEmptyEnvVarOrEmptyString returns the first non-empty environment variable from envVarNames, or returns the empty string
Deprecated: scheduled for removal in Terratest v2. Range over os.Getenv at the call site, e.g.:
for _, name := range envVarNames {
if value := os.Getenv(name); value != "" {
return value
}
}
func GetFirstNonEmptyEnvVarOrFatal
deprecated
GetFirstNonEmptyEnvVarOrFatal returns the first non-empty environment variable from envVarNames, or fails the test if all of them are empty.
Deprecated: scheduled for removal in Terratest v2. Range over os.Getenv at the call site, e.g.:
var value string
for _, name := range envVarNames {
if value = os.Getenv(name); value != "" {
break
}
}
require.NotEmptyf(t, value, "all of %v are empty", envVarNames)
func RequireEnvVar
deprecated
added in
v0.40.1
RequireEnvVar fails the test if the specified environment variable is not defined or is blank.
Deprecated: scheduled for removal in Terratest v2. Use require with os.Getenv at the call site, e.g.:
require.NotEmptyf(t, os.Getenv(name), "environment variable %s must be set", name)
Types ¶
This section is empty.