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