gops
gops copied to clipboard
Check pid/addr of target process was specified for subcommands
gops panics if anything other than help was invoked without specifying the pid/addr of the target:
λ gops stats
panic: runtime error: index out of range
goroutine 1 [running]:
main.main()
E:/Installs/go-tools/src/github.com/google/gops/main.go:68 +0x48a
This adds a check and prints the usage if it was not specified.
λ go run main.go cmd.go stats
gops: pid/addr of target process not specified
gops is a tool to list and diagnose Go processes.
gops <cmd> <pid|addr> ...
gops <pid> # displays process info
...
All commands require the agent running on the Go process.
Symbol "*" indicates the process runs the agent.
exit status 1
Thank you @sudo-suhas for the fix. This looks like the result of a regression from this PR https://github.com/google/gops/pull/59/files#diff-7ddfb3e035b42cd70649cc33393fe32cL55 so basically reverting it.
@rakyll would have more context as to why we removed that check in that PR #59.
Can you rebase this PR?
Done