diff --git a/ssa/builder_test.go b/ssa/builder_test.go index 2344c35c..263012f6 100644 --- a/ssa/builder_test.go +++ b/ssa/builder_test.go @@ -69,9 +69,9 @@ func main() { isExt := pkg != mainPkg // init() - if isExt && !isEmpty(pkg.init) { + if isExt && !isEmpty(pkg.Func("init")) { t.Errorf("external package %s has non-empty init", pkg) - } else if !isExt && isEmpty(pkg.init) { + } else if !isExt && isEmpty(pkg.Func("init")) { t.Errorf("main package %s has empty init", pkg) } diff --git a/ssa/example_test.go b/ssa/example_test.go index 10b03e8a..a64db301 100644 --- a/ssa/example_test.go +++ b/ssa/example_test.go @@ -73,6 +73,7 @@ func main() { // Output: // // package main: + // func init func() // var init$guard *bool // func main func() // const message message = "Hello, World!":untyped string