Files
avo/printer/printer_test.go
Michael McLoughlin 88eff53893 printer: doc for exported symbols
Updates #9
2019-01-04 19:03:05 -08:00

32 lines
657 B
Go

package printer_test
import (
"fmt"
"github.com/mmcloughlin/avo/printer"
)
func ExampleConfig_GeneratedWarning() {
// Default configuration named "avo".
cfg := printer.NewDefaultConfig()
fmt.Println(cfg.GeneratedWarning())
// Name can be customized.
cfg = printer.Config{
Name: "mildred",
}
fmt.Println(cfg.GeneratedWarning())
// Argv takes precedence.
cfg = printer.Config{
Argv: []string{"echo", "hello", "world"},
Name: "mildred",
}
fmt.Println(cfg.GeneratedWarning())
// Output:
// Code generated by avo. DO NOT EDIT.
// Code generated by mildred. DO NOT EDIT.
// Code generated by command: echo hello world. DO NOT EDIT.
}