comment on exported method CloneToAll should be of the form "CloneToAll ..."
92 return
93}
94
95// Clones the pixels for a given id to all other pixel outputs. 96func (pg *PixelGroup) CloneToAll(id string) {
97 if _, ok := pg.Group[id]; !ok {
98 log.Logger.WithField("context", "Pixel Group").Debugf("ID %s does not exist in this pixel group", id)
comment on exported function NewPixelGroup should be of the form "NewPixelGroup ..."
16 TotalLen int // total number of pixels
17}
18
19// creates a pixel group for a slice of device IDs 20func NewPixelGroup(devices map[string]*device.Device, order []string) (pg *PixelGroup, err error) {
21 pg = new(PixelGroup)
22 pg.Group = make(map[string]color.Pixels)
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() {
}