Source file
test/escape_calls.go
1
2
3
4
5
6
7
8
9
10
11
12 package foo
13
14 func f(buf []byte) []byte {
15 return buf
16 }
17
18 func g(*byte) string
19
20 func h(e int) {
21 var x [32]byte
22 g(&f(x[:])[0])
23 }
24
25 type Node struct {
26 s string
27 left, right *Node
28 }
29
30 func walk(np **Node) int {
31 n := *np
32 w := len(n.s)
33 if n == nil {
34 return 0
35 }
36 wl := walk(&n.left)
37 wr := walk(&n.right)
38 if wl < wr {
39 n.left, n.right = n.right, n.left
40 wl, wr = wr, wl
41 }
42 *np = n
43 return w + wl + wr
44 }
45
46
47 func prototype(xyz []string) {}
48 func bar() {
49 var got [][]string
50 f := prototype
51 f = func(ss []string) { got = append(got, ss) }
52 s := "string"
53 f([]string{s})
54 }
55
View as plain text