Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

1234567891011121314151617181920212223242526272829
  1. # Snipdoc
  2. Snipdoc is a simple tool for maintaining package documentation that contains
  3. code samples.
  4. 1. Create a subdirectory of your package to hold the following files. "internal"
  5. is a good name.
  6. 2. Write a template file (for example, "doc.template") with the text of your package documentation. The file
  7. should look exactly like you want your doc.go file to look, except for code
  8. snippets.
  9. Instead of embedding a code snippet, write a line consisting solely of
  10. [NAME]
  11. for your choice of NAME.
  12. 3. Write a snippets file (for example, "doc-snippets.go") as a valid Go source
  13. file. Begin each snippet you'd like to appear in your package docs with
  14. `//[ NAME` and end it with `//]`.
  15. 4. Construct your doc.go file with the command
  16. ```
  17. awk -f snipdoc.awk doc-snippets.go doc.template
  18. ```
  19. The file "sample-makefile" in this directory verifies that the
  20. snippets file compiles and safely constructs a doc.go file.