Skip to content

Instantly share code, notes, and snippets.

@wyattjoh
Last active January 20, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wyattjoh/eb5d578804e8a4df5c73 to your computer and use it in GitHub Desktop.
Save wyattjoh/eb5d578804e8a4df5c73 to your computer and use it in GitHub Desktop.
#!/bin/bash
# list all the packges, trim out the vendor directory and any main packages,
# then strip off the package name
PACKAGES="$(go list -f "{{.Name}}:{{.ImportPath}}" ./... | grep -v -E "main:|vendor/" | cut -d ":" -f 2)"
# loop over all packages generating all their documentation
for PACKAGE in $PACKAGES
do
echo "godoc2md $PACKAGE > $GOPATH/src/$PACKAGE/README.md"
godoc2md $PACKAGE > $GOPATH/src/$PACKAGE/README.md
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment