generate documentation and embed in binary

This commit is contained in:
Gokcehan committed 2016-09-14 00:40:14 +03:00
1 parent 57bebef804
commit 7d2ee16e2d
4 files changed
+125

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
# Generates `docstring.go` having `genDocString` variable with `go doc` output.
#
# This script is called in `doc.go` using `go generate` to embed the
# documentation inside the binary in order to show it on request with `-doc`
# command line flag. Thus the same documentation is used for online and
# terminal display.
echo "package main\n\nvar genDocString = \`$(go doc)\`" > docstring.go