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.
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
76 google oauth config mutator #77
76 google oauth config mutator #77
Changes from 4 commits
6429088
3c2d74d
78c98f3
520614c
0d3b4b8
f83e7e1
653d40b
634cbb0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Go doc requires the first word to be the same as the func name.
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.
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.
Maybe better to use url.Parse(s), check error and if no error use u.String() to have a clean url string.
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.
With the error handling, would you suggest the signature change to
func WithLoginURL(url string) (bool, 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.
I would say return
error
is enough. Either there is an error or not :)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.
I'd suggest we are aiming for consistency on API. It is either
or
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.
I would suggest to go with the first, so return 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.
Makes sense - that seems more idiomatic too. I'll have that shortly..
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.
Sorry for the delay - had some distractions. I was just getting ready to update the PR and noticed that
SetupFromString()
andSetup()
would differ with regards to their return value. TheSetup()
function could more plausibly have errors, however, errors aren't being returned at this time. I do like the idea of returning an errorWithLoginURL()
since there is possibility for a bad URL being added, but I feel like if I return an error fromSetupFromString()
, I should also return an error forSetup()
. While that wouldn't break functionality, it could cause linting errors since return values aren't being accepted and handled. I'm going to make the changes forWithLoginURL()
as prescribed, but I'm interested to get your opinions on handlingSetupFromString()
andSetup()
.