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

Add option to run from URL #156

Merged
merged 3 commits into from Oct 4, 2018
Merged

Add option to run from URL #156

merged 3 commits into from Oct 4, 2018

Conversation

oscerd
Copy link
Contributor

@oscerd oscerd commented Oct 4, 2018

Fixes #137

@oscerd
Copy link
Contributor Author

oscerd commented Oct 4, 2018

I didn't add any option, I checked if the fileName provided is an url http or https and work in that direction

Copy link
Member

@nicolaferraro nicolaferraro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a minor comment

} else {
resp, err := http.Get(fileName)
if err != nil {
return errors.New("The URL provided is not reachable " + fileName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use errors.wrap here (from the other errors package) so you don't lose the error cause

if err != nil {
return errors.New("The URL provided is not reachable " + fileName)
} else if resp.StatusCode != 200 {
return errors.New("The URL provided is not reachable " + fileName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@oscerd
Copy link
Contributor Author

oscerd commented Oct 4, 2018

Done.

@oscerd
Copy link
Contributor Author

oscerd commented Oct 4, 2018

You mean the same also on the control on Filesystem I suppose, I'll update there too.

@oscerd
Copy link
Contributor Author

oscerd commented Oct 4, 2018

Done

@oscerd
Copy link
Contributor Author

oscerd commented Oct 4, 2018

@nicolaferraro

@oscerd oscerd merged commit b670793 into master Oct 4, 2018
@oscerd oscerd deleted the url-support branch October 9, 2018 09:23
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.

None yet

2 participants