go: godoc
This commit is contained in:
parent
54f937ad96
commit
94a03df352
18
go.md
18
go.md
@ -12,10 +12,24 @@ It's easy to understand and teaches you all you need to know.
|
|||||||
# Making a web api
|
# Making a web api
|
||||||
|
|
||||||
> We need to memorize the `Handler` interface.
|
> We need to memorize the `Handler` interface.
|
||||||
> ```go
|
>
|
||||||
> type Handler interface {
|
> type Handler interface {
|
||||||
> ServerHTTP(ResponseWriter, *Request)
|
> ServerHTTP(ResponseWriter, *Request)
|
||||||
> }
|
> }
|
||||||
> ```
|
|
||||||
|
|
||||||
|
|
||||||
|
# `godoc` [^golang-godoc]
|
||||||
|
|
||||||
|
> Godoc parses Go source code - including comments - and produces documentation as HTML or plain
|
||||||
|
> text.
|
||||||
|
> The end result is documentation tightly coupled with the code it documents.
|
||||||
|
> For example, through godoc's web interface [which is at <http://localhost:6060> by default] you can
|
||||||
|
> navigate from a function's documentation to its implementation with one click.
|
||||||
|
|
||||||
|
## Installing godoc // `command not found: godoc`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go get golang.org/x/tools/cmd/godoc
|
||||||
|
```
|
||||||
|
|
||||||
|
[^golang-godoc]: Andrew Gerrand, 31 March 2011 --- <https://blog.golang.org/godoc>
|
||||||
|
Loading…
Reference in New Issue
Block a user