printer: stop printer_test.go looking like generated code

This commit is contained in:
Michael McLoughlin
2019-01-04 19:10:55 -08:00
parent 88eff53893
commit 9d4cd16f88

View File

@@ -6,26 +6,26 @@ import (
"github.com/mmcloughlin/avo/printer"
)
func ExampleConfig_GeneratedWarning() {
func ExampleConfig_GeneratedBy() {
// Default configuration named "avo".
cfg := printer.NewDefaultConfig()
fmt.Println(cfg.GeneratedWarning())
fmt.Println(cfg.GeneratedBy())
// Name can be customized.
cfg = printer.Config{
Name: "mildred",
}
fmt.Println(cfg.GeneratedWarning())
fmt.Println(cfg.GeneratedBy())
// Argv takes precedence.
cfg = printer.Config{
Argv: []string{"echo", "hello", "world"},
Name: "mildred",
}
fmt.Println(cfg.GeneratedWarning())
fmt.Println(cfg.GeneratedBy())
// 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.
// avo
// mildred
// command: echo hello world
}