-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cleanup and refactor code #1
Conversation
This commit cleans up the code and improves its documentation
0349b8c
to
145e23a
Compare
I think some of the comments above your methods need to start with the method name itself in order to be parsed by godoc correctly? https://blog.golang.org/godoc-documenting-go-code I could be wrong! |
fmt.Printf("profile: call graph analyzed %d target(s) and detected %d locations for injecting profiler hooks\n", len(profileFuncs), len(profileTargets)) | ||
profileTargets, err := goPackage.Find(profileFuncs...) | ||
if err != nil { | ||
defer util.ExitWithError(err.Error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a defer
, when we immediately return in the line below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look a couple of lines above I use a defer() call to cleanup the tmp folder. So I am wrapping util.ExitWithError (basically prints and error and calls os.Exit(1)) with a defer so it executes after the cleanup code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait... it executes in reverse order.... :-( I need to update it to use the new cli package which supports errors
Looks like godoc is picking up the comments correctly |
Gotcha! 🍰 |
No description provided.