Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / go / pointer / testdata / fmtexcerpt.go
1 // +build ignore
2
3 // This is a slice of the fmt package.
4
5 package main
6
7 type pp struct {
8         field interface{}
9 }
10
11 func newPrinter() *pp {
12         return new(pp)
13 }
14
15 func Fprintln(a ...interface{}) {
16         p := newPrinter()
17         p.doPrint(a, true, true)
18 }
19
20 func Println(a ...interface{}) {
21         Fprintln(a...)
22 }
23
24 func (p *pp) doPrint(a []interface{}, addspace, addnewline bool) {
25         print(a[0]) // @types S | string
26         stringer := a[0].(interface {
27                 String() string
28         })
29
30         stringer.String()
31         print(stringer) // @types S
32 }
33
34 type S int
35
36 func (S) String() string { return "" }
37
38 func main() {
39         Println("Hello, World!", S(0))
40 }
41
42 // @calls (*main.pp).doPrint -> (main.S).String