diff options
Diffstat (limited to 'cmd/guru')
-rw-r--r-- | cmd/guru/guru.go | 5 | ||||
-rw-r--r-- | cmd/guru/guru_test.go | 3 | ||||
-rw-r--r-- | cmd/guru/main.go | 4 | ||||
-rw-r--r-- | cmd/guru/testdata/src/implements/main.golden | 2 | ||||
-rw-r--r-- | cmd/guru/testdata/src/pointsto/main.golden | 2 | ||||
-rw-r--r-- | cmd/guru/testdata/src/reflection/main.golden | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/cmd/guru/guru.go b/cmd/guru/guru.go index 8dea3b537..2eafca654 100644 --- a/cmd/guru/guru.go +++ b/cmd/guru/guru.go @@ -126,8 +126,7 @@ func setPTAScope(lconf *loader.Config, scope []string) error { // and their dependencies. func setupPTA(prog *ssa.Program, lprog *loader.Program, ptaLog io.Writer, reflection bool) (*pointer.Config, error) { // For each initial package (specified on the command line), - // if it has a main function, analyze that, - // otherwise analyze its tests, if any. + // analyze the package if it has a main function. var mains []*ssa.Package for _, info := range lprog.InitialPackages() { p := prog.Package(info.Pkg) @@ -135,8 +134,6 @@ func setupPTA(prog *ssa.Program, lprog *loader.Program, ptaLog io.Writer, reflec // Add package to the pointer analysis scope. if p.Pkg.Name() == "main" && p.Func("main") != nil { mains = append(mains, p) - } else if main := prog.CreateTestMainPackage(p); main != nil { - mains = append(mains, main) } } if mains == nil { diff --git a/cmd/guru/guru_test.go b/cmd/guru/guru_test.go index 0699db9ee..d446f0142 100644 --- a/cmd/guru/guru_test.go +++ b/cmd/guru/guru_test.go @@ -215,6 +215,9 @@ func doQuery(out io.Writer, q *query, json bool) { } for _, output := range outputs { + // Replace occurrences of interface{} with any, for consistent output + // across go 1.18 and earlier. + output = strings.ReplaceAll(output, "interface{}", "any") fmt.Fprintf(out, "%s\n", output) } diff --git a/cmd/guru/main.go b/cmd/guru/main.go index 8e4af004a..4fde4d2d2 100644 --- a/cmd/guru/main.go +++ b/cmd/guru/main.go @@ -105,8 +105,8 @@ Example: describe syntax at offset 530 in this file (an import spec): ` func printHelp() { - fmt.Fprintln(os.Stderr, helpMessage) - fmt.Fprintln(os.Stderr, "Flags:") + fmt.Fprint(os.Stderr, helpMessage) + fmt.Fprintln(os.Stderr, "\nFlags:") flag.PrintDefaults() } diff --git a/cmd/guru/testdata/src/implements/main.golden b/cmd/guru/testdata/src/implements/main.golden index 1077c9827..71d00ce7d 100644 --- a/cmd/guru/testdata/src/implements/main.golden +++ b/cmd/guru/testdata/src/implements/main.golden @@ -13,7 +13,7 @@ interface type FG implements F -------- @implements slice -------- -slice type []int implements only interface{} +slice type []int implements only any -------- @implements C -------- pointer type *C diff --git a/cmd/guru/testdata/src/pointsto/main.golden b/cmd/guru/testdata/src/pointsto/main.golden index 7b12b2aff..40a830f08 100644 --- a/cmd/guru/testdata/src/pointsto/main.golden +++ b/cmd/guru/testdata/src/pointsto/main.golden @@ -81,7 +81,7 @@ this map[string]*int may point to these objects: Error: pointer analysis wants an expression of reference type; got () -------- @pointsto var-ref-s-f -------- -this interface{} may contain these dynamic types: +this any may contain these dynamic types: chan bool, may point to: makechan diff --git a/cmd/guru/testdata/src/reflection/main.golden b/cmd/guru/testdata/src/reflection/main.golden index 4782132bd..2a84071a3 100644 --- a/cmd/guru/testdata/src/reflection/main.golden +++ b/cmd/guru/testdata/src/reflection/main.golden @@ -8,7 +8,7 @@ this reflect.Value may contain these dynamic types: makemap -------- @pointsto p1 -------- -this interface{} may contain these dynamic types: +this any may contain these dynamic types: *bool, may point to: reflection.b *int, may point to: |