compiler: initialize packages according to go spec
`init()` functions should be called during package initialization, after global variables were processed.
This commit is contained in:
parent
6f2759be3a
commit
439d9ff94d
4 changed files with 37 additions and 5 deletions
4
pkg/compiler/testdata/pkg3/pkg3.go
vendored
4
pkg/compiler/testdata/pkg3/pkg3.go
vendored
|
@ -1,3 +1,7 @@
|
|||
package pkg3
|
||||
|
||||
var A int
|
||||
|
||||
func init() {
|
||||
A = 3
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue