Adds snippet to check err before using res in GoNative#276
Merged
umeshp7 merged 8 commits intopostmanlabs:developfrom Oct 8, 2020
Merged
Adds snippet to check err before using res in GoNative#276umeshp7 merged 8 commits intopostmanlabs:developfrom
umeshp7 merged 8 commits intopostmanlabs:developfrom
Conversation
- adds err check after client.Do(req) - adds println and return statement inside err condition body
Member
|
@someshkoli The original issue also mentions using http/https as a URL prefix. Also, can you update your comment to include the before/after snippet? |
- adds err check for ioutils.ReadAll method - removes unwanted console.log statements
Contributor
Author
Also I was not sure about the http/https thing as that can also be done through the postmanapp so is a check required anyway ? Like we encounter error of invalid url in nodejs-request too when https/http is not provided in the url ? |
We should return from the function if an err is produced in all cases.
webholik
approved these changes
Sep 28, 2020
umeshp7
approved these changes
Oct 8, 2020
This was referenced Oct 8, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes: postmanlabs/postman-app-support#8318 partially
The err due to absence of
errcheck is caused by go vet(kind of linting for go), which forces strict formatting, this includes checking for err being nil or not if we have assigned some value toerr.So basically if anyone uses go vet then
errchecking is mandatory if it has been assigned:if err!=nil { //do something }