mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
text that you indent inside a comment, godoc will render as a pre-formatted block
parent
f5ada43e72
commit
5b344398b7
15
Comments.md
15
Comments.md
@ -21,3 +21,18 @@ func enterOrbit() os.Error {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
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 {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user