Today I Learned

2024/09/24

go doc code block

That you an render code blocks in Go doc comments by indenting the lines of code:

// Add two numbers.
//   this
//   is a
//   code block
func Add(a, b int) int {
  return a + b
}

See https://tip.golang.org/doc/comment#code