-
A function shouldn’t have a lot of parameters. Make sure your function isn’t doing too much.
-
Outside of
fmt.Printlnand other well-known functions, use _ to explicitly mark ignored return values. -
Never use a blank (naked) return in a function that returns values. It forces the reader to scan the entire function to figure out what value is being returned.
-
Watch out for shadowing named return values. Confirm that you’re assigning to the return variable, not accidentally creating a new one with
:=.
Progress is saved on this device.