comment on exported method CodeName should be of the form "CodeName ..."
62 return fmt.Sprintf("%s-%s-%s", adjective, noun, ptype)
63}
64
65// Name returns a music name for a project66func (f Project) CodeName() string {
67 var (
68 adjective = f.Faker.RandomStringElement(projectAdjectives)
comment on exported method RepositoryName should be of the form "RepositoryName ..."
52 Faker *Faker
53}
54
55// Name returns a music name for a project56func (f Project) RepositoryName() string {
57 var (
58 adjective = f.Faker.RandomStringElement(projectAdjectives)
Description
Doc comments work best as complete sentences, which allow a wide variety of automated presentations. The first sentence should be a one-sentence summary that starts with the name being declared.
If every doc comment begins with the name of the item it describes, you can use the doc subcommand of the go tool and run the output through grep.
See https://golang.org/doc/effective_go.html#commentary for more information on how to write good documentation.
Bad practice
package main
// This function tries to summon a cybernetically enhanced duck
func SummonDucks() {
}
Recommended
package main
// SummonDucks tries to summon a cybernetically enhanced duck
func SummonDucks() {
}