doc.go 868 B

123456789101112131415
  1. // Package generator defines an interface for code generators to implement.
  2. //
  3. // To use this package, you'll implement the "Package" and "Generator"
  4. // interfaces; you'll call NewContext to load up the types you want to work
  5. // with, and then you'll call one or more of the Execute methods. See the
  6. // interface definitions for explanations. All output will have gofmt called on
  7. // it automatically, so you do not need to worry about generating correct
  8. // indentation.
  9. //
  10. // This package also exposes SnippetWriter. SnippetWriter reduces to a minimum
  11. // the boilerplate involved in setting up a template from go's text/template
  12. // package. Additionally, all naming systems in the Context will be added as
  13. // functions to the parsed template, so that they can be called directly from
  14. // your templates!
  15. package generator // import "go-common/app/tool/gengo/generator"