[go: up one dir, main page]

Today I Learned

tags


2024/09/24

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