From 71e1c684458ce2fd76ce8d99c564b09fb03e9c33 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 10 Jul 2013 22:14:40 -0700 Subject: [PATCH] go.tools/ssa: fix build Caused by https://golang.org/cl/11093044/ . R=adonovan CC=golang-dev https://golang.org/cl/11149043 --- ssa/builder_test.go | 4 ++-- ssa/example_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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