...
1 package A1
2
3 import (
4 . "fmt"
5 myfmt "fmt"
6 "os"
7 "strings"
8 )
9
10 func example(n int) {
11 x := "foo" + strings.Repeat("\t", n)
12
13 myfmt.Errorf("%s", x)
14
15
16 Errorf("%s", x)
17
18
19 myfmt.Errorf("%s", x)
20
21
22 myfmt.Errorf("%s", 3)
23
24
25 myfmt.Printf("%s", x)
26
27
28 Printf("%s", x)
29
30
31 myfmt.Fprint(os.Stderr, myfmt.Errorf("%s", x+"foo"))
32
33
34
35 var fmt struct{ Errorf func(string, string) }
36 fmt.Errorf("%s", x)
37
38
39
40
41 myfmt.Errorf("%s", myfmt.Errorf("%s", x+"foo").Error())
42
43
44 myfmt.Errorf("%s", myfmt.Errorf("%s", 3).Error())
45
46
47
48 myfmt.Errorf("%s", myfmt.Errorf("%s", x+"foo"))
49 }
50
View as plain text