| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | ) |
| 6 | |
| 7 | type Foo struct { |
| 8 | A string |
| 9 | } |
| 10 | |
| 11 | var f = Foo{"world"} // <-- the root cause |
| 12 | |
| 13 | func Hello() { |
| 14 | fmt.Println("in") |
| 15 | } |
| 16 | |
| 17 | var name = "v1" // <-- the root cause |
| 18 | |
| 19 | func main() { |
| 20 | Hello() |
| 21 | fmt.Println("Hello", f.A, name) |
| 22 | } |
| 23 | |
| 24 | // Output: |
| 25 | // in |
| 26 | // Hello world v1 |