Permalink
Browse files

adding String method to generated content type with better default fo…

…r easier feature discovery
  • Loading branch information...
nilslice committed Aug 23, 2017
1 parent cbb9f90 commit e9f9205b7199d7edffd53d9a45b38b57ccdc0ae1
Showing with 6 additions and 0 deletions.
  1. +6 −0 cmd/ponzu/templates/gen-content.tmpl
@@ -38,4 +38,10 @@ func ({{ .Initial }} *{{ .Name }}) MarshalEditor() ([]byte, error) {
func init() {
item.Types["{{ .Name }}"] = func() interface{} { return new({{ .Name }}) }
}
// String defines how a {{ .Name }} is printed. Update it using more descriptive
// fields from the {{ .Name }} struct type
func ({{ .Initial }} *{{ .Name }}) String() string {
return fmt.Sprintf("{{ .Name }}: %s", {{ .Initial }}.UUID)
}

0 comments on commit e9f9205

Please sign in to comment.