func TestFloat64Default(t *testing.T) { in, out := float64(5.2), float64(5.2) os.Clearenv() if got := env.Float64("FLOAT64_DEFAULT", in); got != out { t.Errorf(`Float64("FLOAT64_DEFAULT", %v) = %v, want %v`, in, got, out) } }
func TestFloat64(t *testing.T) { in, out := float64(1.1), float64(2.5) os.Setenv("FLOAT64", "2.5") if got := env.Float64("FLOAT64", in); got != out { t.Errorf(`Float64("FLOAT64", %v) = %v, want %v`, in, got, out) } }
func ExampleFloat64() { os.Setenv("FLOAT64", "1.23") fmt.Println(env.Float64("FLOAT64", 0)) // Output: 1.23 }