func fn(c color.Color) { switch c { case color.Red, color.Green, color.Blue: log.Printf("c=%#+v -- OK", c) default: log.Printf("c=%#+v -- should not be possible", c) } } func main() { var c color.Color fn(c) }
c=<nil> -- should not be possible