Source file
test/linkx.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 import "fmt"
13
14 var tbd string
15 var overwrite string = "dibs"
16
17 var tbdcopy = tbd
18 var overwritecopy = overwrite
19 var arraycopy = [2]string{tbd, overwrite}
20
21 var b bool
22 var x int
23
24 func main() {
25 fmt.Println(tbd)
26 fmt.Println(tbdcopy)
27 fmt.Println(arraycopy[0])
28
29 fmt.Println(overwrite)
30 fmt.Println(overwritecopy)
31 fmt.Println(arraycopy[1])
32
33
34
35 if b || x != 0 {
36 panic("b or x overwritten")
37 }
38 }
39
View as plain text