The image.NewUniform function is exported and should have a comment per https://golang.org/doc/effective_go.html#commentary.
This came up when I realized it's not clear whether it's better to write image.NewUniform(c) or &image.Uniform{c}. I thought maybe image.NewUniform is deprecated like image.ZP, but that's not the case given it doesn't even have a comment. But it's not easy to feel confident using an exported method in the Go standard library when it's not documented.
https://blog.golang.org/image-draw prefers &image.Uniform{c} style, but it's also from 2011. NewUniform was renamed from NewColorImage in 2011, so it has existed for quite a while.
/cc @nigeltao @robpike
The
image.NewUniformfunction is exported and should have a comment per https://golang.org/doc/effective_go.html#commentary.This came up when I realized it's not clear whether it's better to write
image.NewUniform(c)or&image.Uniform{c}. I thought maybeimage.NewUniformis deprecated likeimage.ZP, but that's not the case given it doesn't even have a comment. But it's not easy to feel confident using an exported method in the Go standard library when it's not documented.https://blog.golang.org/image-draw prefers
&image.Uniform{c}style, but it's also from 2011.NewUniformwas renamed fromNewColorImagein 2011, so it has existed for quite a while./cc @nigeltao @robpike