Debian Codegraph @

printer/printer_test.go

raw symbols SCIP
1 package printer_test
2
3 import (
4 "fmt"
5
6 "github.com/mmcloughlin/avo/printer"
7 )
8
9 func ExampleConfig_GeneratedBy() {
10 // Default configuration named "avo".
11 cfg := printer.NewDefaultConfig()
12 fmt.Println(cfg.GeneratedBy())
13
14 // Name can be customized.
15 cfg = printer.Config{
16 Name: "mildred",
17 }
18 fmt.Println(cfg.GeneratedBy())
19
20 // Argv takes precedence.
21 cfg = printer.Config{
22 Argv: []string{"echo", "hello", "world"},
23 Name: "mildred",
24 }
25 fmt.Println(cfg.GeneratedBy())
26
27 // Output:
28 // avo
29 // mildred
30 // command: echo hello world
31 }