diff --git a/go/ssa/example_test.go b/go/ssa/example_test.go index c33b6d62..de5ed5e1 100644 --- a/go/ssa/example_test.go +++ b/go/ssa/example_test.go @@ -49,7 +49,7 @@ func main() { // with similar functionality. It is located at // golang.org/x/tools/cmd/ssadump. // -func ExampleBuildPackage() { +func Example_buildPackage() { // Parse the source files. fset := token.NewFileSet() f, err := parser.ParseFile(fset, "hello.go", hello, parser.ParseComments) @@ -117,7 +117,7 @@ func ExampleBuildPackage() { // This example builds SSA code for a set of packages using the // x/tools/go/packages API. This is what you would typically use for a // analysis capable of operating on a single package. -func ExampleLoadPackages() { +func Example_loadPackages() { // Load, parse, and type-check the initial packages. cfg := &packages.Config{Mode: packages.LoadSyntax} initial, err := packages.Load(cfg, "fmt", "net/http") @@ -147,7 +147,7 @@ func ExampleLoadPackages() { // This example builds SSA code for a set of packages plus all their dependencies, // using the x/tools/go/packages API. // This is what you'd typically use for a whole-program analysis. -func ExampleLoadWholeProgram() { +func Example_loadWholeProgram() { // Load, parse, and type-check the whole program. cfg := packages.Config{Mode: packages.LoadAllSyntax} initial, err := packages.Load(&cfg, "fmt", "net/http") diff --git a/go/ssa/sanity.go b/go/ssa/sanity.go index 6eb64328..0a7abc5e 100644 --- a/go/ssa/sanity.go +++ b/go/ssa/sanity.go @@ -408,8 +408,8 @@ func (s *sanity) checkFunction(fn *Function) bool { s.errorf("nil Prog") } - fn.String() // must not crash - fn.RelString(fn.pkg()) // must not crash + _ = fn.String() // must not crash + _ = fn.RelString(fn.pkg()) // must not crash // All functions have a package, except delegates (which are // shared across packages, or duplicated as weak symbols in a @@ -499,7 +499,7 @@ func sanityCheckPackage(pkg *Package) { if pkg.Pkg == nil { panic(fmt.Sprintf("Package %s has no Object", pkg)) } - pkg.String() // must not crash + _ = pkg.String() // must not crash for name, mem := range pkg.Members { if name != mem.Name() {