Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckUnsafePrintf / CheckUnsafePrintf.go
1 package pkg
2
3 import (
4         "fmt"
5         "log"
6         "os"
7 )
8
9 func fn(s string) {
10         fn2 := func() string { return "" }
11         fmt.Printf(fn2())      // want `should use print-style function`
12         _ = fmt.Sprintf(fn2()) // want `should use print-style function`
13         log.Printf(fn2())      // want `should use print-style function`
14         fmt.Printf(s)          // want `should use print-style function`
15         fmt.Printf(s, "")
16         fmt.Fprintf(os.Stdout, s) // want `should use print-style function`
17         fmt.Fprintf(os.Stdout, s, "")
18
19         fmt.Printf(fn2(), "")
20         fmt.Printf("")
21         fmt.Printf("%s", "")
22 }