Skip to content
natefinch edited this page Feb 6, 2013 · 3 revisions

If you're using gocog in your project, I'd love to have you write a little bit here about how you use gocog.

Gocog uses gocog! I use gocog to generate some of the documentation. I include the actual usage output of the program in the documentation, and instead of copy and pasting it every time, I just have gocog run itself and pipe the output into the comments. That way it's always up to date. I also use it to generate a build number (really a date stamp) into the version output.

  • gocog.go
  • boring standard use, just output a datestamp that is used in the version output
  • README.md
  • README.md uses custom markers to avoid confusing the tool, since it has the standard markers in the text.
  • Used to copy the version output and usage output from the actual program into the documentation.
  • main.go
  • I use --eof to remove the need for the end tag here
  • Copies usage output into documentation
  • doc.go
  • uses single line comment tags, just to show how that can work, also uses --eof
  • Copies usage output into documentation

The command line I use for gocog's own use is gocog @files.txt.

@files.txt has different command lines for the different files, based on their usage, so I don't have to retype the command line each time (the only real annoying part is the special delimiters for README.md)

gsnmpgo is a go/cgo wrapper around gsnmp; it currently provides support for snmp v1 and v2c, and snmp get, snmp getnext, and snmp walk.

Sonia Hamilton, [email protected], http://www.snowfrog.net.

Clone this wiki locally