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 / simple / testdata / src / CheckSimplifyTypeSwitch / LintSimplifyTypeSwitch.go
1 package pkg
2
3 import "fmt"
4
5 func gen() interface{} { return nil }
6
7 func fn(x, y interface{}) {
8         switch z := x.(type) {
9         case int:
10                 _ = z
11                 fmt.Println(x.(int))
12         }
13         switch x.(type) {
14         case int:
15                 fmt.Println(x.(int), y.(int))
16         }
17         switch x.(type) { // want `assigning the result of this type assertion`
18         case int:
19                 fmt.Println(x.(int))
20         }
21         switch x.(type) {
22         case int:
23                 fmt.Println(x.(string))
24         }
25         switch x.(type) {
26         case int:
27                 fmt.Println(y.(int))
28         }
29         switch (gen()).(type) {
30         case int:
31                 fmt.Println((gen()).(int))
32         }
33 }