Go Time: Golang, Software Engineering

The bits of Go we avoid (and why)

13 snips
Mar 16, 2023
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

Avoid Naked Returns

  • Avoid naked returns (using "return" without values) in Go functions.
  • Use explicit return values for clarity and to avoid potential bugs, even with named returns.
ANECDOTE

Decorated Comments Annoyance

  • Carl Johnson finds overly decorated comments (with ASCII art, stars, etc.) annoying.
  • Changing these comments is tedious as they become uneven, which outweighs their visual appeal.
ADVICE

Avoid Panics

  • Avoid panics in production Go code.
  • Handle errors gracefully instead, reserving panics for unrecoverable programmer errors.
Get the Snipd Podcast app to discover more snips from this episode
Get the app