import ( "fmt" "github.com/wercker/wercker/util" ) func main() { apiToken := util.GetEnv("WERCKER_API_TOKEN", "") fmt.Println("API token is:", apiToken) }
import ( "flag" "github.com/wercker/wercker/util" ) func main() { var name string flag.StringVar(&name, "name", util.GetEnv("WERCKER_USERNAME", ""), "your name") flag.Parse() fmt.Printf("Hello, %s!\n", name) }This example sets a default value for the "name" command line argument. If the argument is not provided at runtime, the value of the "WERCKER_USERNAME" environment variable will be used instead. Overall, the go github.com/wercker/wercker/util Settings package provides a convenient and straightforward way to access and manipulate settings for deploying on Wercker CI/CD platform.