printer: stop printer_test.go looking like generated code
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user