1
2
3
4
5
6
7
8
9
10
11 package main
12
13 import "fmt"
14
15 const tpl = `
16 func init() {
17 var i %s
18 j := %s(i)
19 _ = %s(j)
20 }
21 `
22
23 func main() {
24 fmt.Println("package main")
25 ntypes := []string{
26 "byte", "rune", "uintptr",
27 "float32", "float64",
28 "int", "int8", "int16", "int32", "int64",
29 "uint", "uint8", "uint16", "uint32", "uint64",
30 }
31 for i, from := range ntypes {
32 for _, to := range ntypes[i:] {
33 fmt.Printf(tpl, from, to, from)
34 }
35 }
36 fmt.Println("func main() {}")
37 }
38
View as plain text