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

Must* and HTTP functions #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GeertJohan
Copy link
Contributor

Sorry for having two features in one PR. The second feature requires the first one.

I have added a wrapper for simple HTTP GET's: HTTPGetString(url string) returns the HTTP GET response body as string and optionally an error.
That function is wrapped by MustHTTPGetString(url string), which doesnt return a second value (error), but instead panics when an error occurs. The panic is recovered at *Project.run(..) so it is nicely printed without stacktrace.

I think the Must* approach can be used for multiple other godo helper functions.

Add HTTPGetString and MustHTTPGetString
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.

2 participants