func TestStringDefault(t *testing.T) { in, out := "baz", "baz" os.Clearenv() if got := env.String("STRING_DEFAULT", in); got != out { t.Errorf(`String("STRING_DEFAULT", "%v") = %v, want %v`, in, got, out) } }
func TestString(t *testing.T) { in, out := "baz", "bar" os.Setenv("STRING", out) if got := env.String("STRING", in); got != out { t.Errorf(`String("STRING", "%v") = %v, want %v`, in, got, out) } }
func ExampleString() { os.Setenv("STRING", "foo bar") fmt.Println(env.String("STRING", "")) // Output: foo bar }