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

make UserIdentifierInput fields pointers #301

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

davidbloss
Copy link
Contributor

Issues

#145 - partial fix

Changelog

Make UserIdentifierInput fields pointers to enable expected omitempty json tag behavior

  • List your changes here
  • Make a changie entry

Tophatting

task test - all tests pass

@davidbloss davidbloss requested review from rocktavious and a user November 10, 2023 19:59
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Merging #301 (9048c95) into main (081e76b) will not change coverage.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##             main     #301   +/-   ##
=======================================
  Coverage   76.75%   76.75%           
=======================================
  Files          49       49           
  Lines        3299     3299           
=======================================
  Hits         2532     2532           
  Misses        564      564           
  Partials      203      203           
Files Coverage Δ
user.go 79.46% <50.00%> (ø)

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM!

@davidbloss davidbloss merged commit 79961b0 into main Nov 10, 2023
5 checks passed
@davidbloss davidbloss deleted the db/bugfix-identifier-input-needs-pointers branch November 10, 2023 20:13
@@ -797,7 +797,7 @@ func TestTeamAddMemberhip(t *testing.T) {
team, _ := clientWithAlias.GetTeamWithAlias("example")
newMembership := ol.TeamMembershipUserInput{
Role: "user",
User: ol.UserIdentifierInput{Id: id1, Email: "[email protected]"},
User: ol.UserIdentifierInput{Id: &id1, Email: ol.NewString("[email protected]")},
Copy link
Collaborator

@rocktavious rocktavious Nov 10, 2023

Choose a reason for hiding this comment

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

I "think" this should probably actually be using NewUserIdentifier("[email protected]") - One thing i've been reading up about with idomatic go is that we should really push to use "constructors" for all our types so we can present better interfaces to "setup" objects and then also have a handle to do things like what we do in NewUserIdentifier where we convert the "string" of e-mail into a *string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Introducing NewUserIdentifier() here would make the line read as:
User: NewUserIdentifier("[email protected]"),
but then we are getting a UserIdentifier without an Id

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