When I run this Example test below using
go test -timeout 30s -tags -run ^ExampleNewSettings$
func ExampleNewSettings() {
s := NewSettings()
s.Set("FontName", "Manlo")
s.Set("FontSize", 12)
s.Set("FontColor", color.Black)
fmt.Println(s.Get("FontName"))
fmt.Println(s.Get("FontSize"))
fmt.Println(s.Get("FontColor"))
fmt.Println(s.Get("notfound"))
//Output:
//Manlo
//12
//color.Black
//<nil>
}
The test fails no matter how I represent the nil return from the last Println. go test produces
– FAIL: ExampleNewSettings (0.00s)
got:
Manlo true
12 true
{0} true
<nil> false want: Manlo 12 color.Black
FAIL
exit status 1
Is there a way of representing a nil output?
Thanks,