golang/gddo

proposal: specify renamed imports in examples

gbbr opened this issue · 0 comments

gbbr commented

Code example that use named import paths can render the code confusing because it is unclear to the reader which package the import refers to. Regardless of whether these are considered an anti-pattern or not, it's a valid use case and it would be helpful to cover for.

Example documentation with the problem: https://godoc.org/gopkg.in/DataDog/dd-trace-go.v1/contrib/gorilla/mux.

A possible solution would be:

Screenshot 2019-09-10 at 11 32 19

Where this would be shown only for named imports.