Skip to content

image: NewUniform doesn't have documentation #38739

@dmitshur

Description

@dmitshur

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions