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
Added Organization commands #11
Conversation
Also: - Created an utility function to do null checks - Stubbed the future organization functions
package utils | ||
|
||
// CoalesceString returns empty string on null, otherwise returns the value | ||
func CoalesceString(value *string) 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.
I added this little func to help me avoid splattering the code with if/else. Let me know what you think
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.
It's fine
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.
It's easy as you say it is. Haven't tested it but looks good.
At this pace, I'm wondering if you can spend some time thinking about how to optimize the code instead. Maybe create a function for each CRUD operation take takes in the client func, response type, body (if applicable), etc... because there's a lot of copying and pasting going around here. Maybe take a closer look at api/client.gen.go as it has more functions that take in more abstract things.
package utils | ||
|
||
// CoalesceString returns empty string on null, otherwise returns the value | ||
func CoalesceString(value *string) 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.
It's fine
I can look at reducing boilerplate code, but all I can think off right now isn't supported in golang 😭 |
Also generated the doc and fixed some typos
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.
Looks great! Cheers! 🍻
Added commands for organization management
Closes #7