-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix: cannot create env0_user_team_assignment: validation error #682
Conversation
@@ -34,7 +33,8 @@ func (a *UserTeamAssignment) GetId() string { | |||
} | |||
|
|||
func GetUserTeamAssignmentFromId(id string) (*UserTeamAssignment, error) { | |||
splitUserTeam := strings.Split(id, "_") | |||
// lastSplit is used to avoid issues where the user_id has underscores in it. | |||
splitUserTeam := lastSplit(id, "_") | |||
if len(splitUserTeam) != 2 { |
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 think this will error if splitUserTeam is nil.
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.
in golang len(nil)
returns 0
.
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 good overall, left some comments
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.
LGTM, my comments were addressed
please try and comment your commit hash that resolves a comment, it makes reviewing easier 😃 |
Issue & Steps to Reproduce / Feature Request
fixes #681
Solution
Some user ids have an "_". Original solution assumed it's not possible.