diff --git a/Comments.md b/Comments.md index b5339937..41579304 100644 --- a/Comments.md +++ b/Comments.md @@ -20,4 +20,19 @@ Nearly every top-level type, const, var and func should have a comment. A commen func enterOrbit() os.Error { ... } -``` \ No newline at end of file +``` + +All text that you indent inside a comment, godoc will render as a pre-formatted block. This facilitates code samples. + +```go +// fight can be used on any enemy and returns whether Superman won. +// +// Examples: +// +// fight("a random potato") +// fight(LexLuthor{}) +// +func fight(enemy interface{}) bool { + ... +} +```