Skip to content

Commit

Permalink
simplify the use of toolexecCmd in reverse
Browse files Browse the repository at this point in the history
The list flags are entirely unused, so they can be omitted.
The only argument that matters is the package argument to load.
While here, update the TODO, as it no longer applies.
  • Loading branch information
mvdan authored and lu4p committed Dec 4, 2024
1 parent 4e71f1a commit 6ac80db
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions reverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,9 @@ One can reverse a captured panic stack trace as follows:
}

pkg, args := args[0], args[1:]
listArgs := []string{
"-json",
"-deps",
"-export",
}
listArgs = append(listArgs, flags...)
listArgs = append(listArgs, pkg)
// TODO: We most likely no longer need this "list -toolexec" call, since
// we use the original build IDs.
_, err := toolexecCmd("list", listArgs)
// We don't actually run `go list -toolexec=garble`; we only use toolexecCmd
// to ensure that sharedCache.ListedPackages is filled.
_, err := toolexecCmd("list", []string{pkg})
defer os.RemoveAll(os.Getenv("GARBLE_SHARED"))
if err != nil {
return err
Expand Down

0 comments on commit 6ac80db

Please sign in to comment.