mirror of
https://github.com/burrowers/garble.git
synced 2025-09-26 20:01:16 +08:00
simplify the use of toolexecCmd in reverse
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.
This commit is contained in:

committed by
Paul Scheduikat

parent
4e71f1aee3
commit
6ac80db02c
13
reverse.go
13
reverse.go
@@ -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
|
||||
|
Reference in New Issue
Block a user