Robert Kroeger | ddcace0 | 2014-09-29 14:02:08 -0700 | [diff] [blame] | 1 | // The following enables go generate to generate the doc.go file. |
| 2 | // Things to look out for: |
| 3 | // 1) go:generate evaluates double-quoted strings into a single argument. |
| 4 | // 2) go:generate performs $NAME expansion, so the bash cmd can't contain '$'. |
| 5 | // 3) We generate into a *.tmp file first, otherwise go run will pick up the |
| 6 | // initially empty *.go file, and fail. |
| 7 | // |
| 8 | //go:generate bash -c "{ echo -e '// This file was auto-generated via go generate.\n// DO NOT UPDATE MANUALLY\n\n/*' && veyron go run *.go help -style=godoc ... && echo -e '*/\npackage main'; } > ./doc.go.tmp && mv ./doc.go.tmp ./doc.go" |
| 9 | |
| 10 | package main |
| 11 | |
| 12 | import ( |
| 13 | "veyron.io/veyron/veyron2/rt" |
| 14 | |
| 15 | _ "veyron.io/veyron/veyron/profiles" |
| 16 | ) |
| 17 | |
| 18 | func main() { |
| 19 | defer rt.Init().Cleanup() |
| 20 | root().Main() |
| 21 | } |