Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check pid/addr of target process was specified for subcommands #71

Closed
wants to merge 1 commit into from

Conversation

sudo-suhas
Copy link
Contributor

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

@odeke-em
Copy link
Collaborator

odeke-em commented Mar 4, 2018

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.

@rakyll
Copy link
Member

rakyll commented May 2, 2018

Can you rebase this PR?

@sudo-suhas sudo-suhas force-pushed the check-target-specified branch from c5fb1c1 to 531b8b8 Compare May 2, 2018 14:48
@sudo-suhas
Copy link
Contributor Author

Done

@sudo-suhas sudo-suhas closed this Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants