diff --git a/github/github-accessors.go b/github/github-accessors.go index 7bd3e0b6493..1685959173c 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -26894,14 +26894,6 @@ func (u *User) GetID() int64 { return *u.ID } -// GetInheritedFrom returns the InheritedFrom field. -func (u *User) GetInheritedFrom() *Team { - if u == nil { - return nil - } - return u.InheritedFrom -} - // GetLdapDn returns the LdapDn field if it's non-nil, zero value otherwise. func (u *User) GetLdapDn() string { if u == nil || u.LdapDn == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index e39f9112242..cee65415517 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -34569,14 +34569,6 @@ func TestUser_GetID(tt *testing.T) { u.GetID() } -func TestUser_GetInheritedFrom(tt *testing.T) { - tt.Parallel() - u := &User{} - u.GetInheritedFrom() - u = nil - u.GetInheritedFrom() -} - func TestUser_GetLdapDn(tt *testing.T) { tt.Parallel() var zeroValue string diff --git a/github/github-stringify_test.go b/github/github-stringify_test.go index ec811fc5d3c..948a9547a4d 100644 --- a/github/github-stringify_test.go +++ b/github/github-stringify_test.go @@ -2095,9 +2095,8 @@ func TestUser_String(t *testing.T) { SubscriptionsURL: Ptr(""), RoleName: Ptr(""), Assignment: Ptr(""), - InheritedFrom: &Team{}, } - want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:"", RoleName:"", Assignment:"", InheritedFrom:github.Team{}}` + want := `github.User{Login:"", ID:0, NodeID:"", AvatarURL:"", HTMLURL:"", GravatarID:"", Name:"", Company:"", Blog:"", Location:"", Email:"", Hireable:false, Bio:"", TwitterUsername:"", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:"", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:"", URL:"", EventsURL:"", FollowingURL:"", FollowersURL:"", GistsURL:"", OrganizationsURL:"", ReceivedEventsURL:"", ReposURL:"", StarredURL:"", SubscriptionsURL:"", RoleName:"", Assignment:""}` if got := v.String(); got != want { t.Errorf("User.String = %v, want %v", got, want) } diff --git a/github/users.go b/github/users.go index 60f1e06a694..28db59c5e1a 100644 --- a/github/users.go +++ b/github/users.go @@ -77,7 +77,7 @@ type User struct { Assignment *string `json:"assignment,omitempty"` // InheritedFrom identifies the team that a user inherited their organization role // from. This is only populated when calling the ListUsersAssignedToOrgRole method. - InheritedFrom *Team `json:"inherited_from,omitempty"` + InheritedFrom []*Team `json:"inherited_from,omitempty"` } func (u User) String() string {