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

Update team.go to accept a context.Context #308

Merged
merged 1 commit into from
Mar 17, 2021
Merged

Update team.go to accept a context.Context #308

merged 1 commit into from
Mar 17, 2021

Conversation

theckman
Copy link
Collaborator

@theckman theckman commented Mar 6, 2021

Replaces #262

Updates #267


// AddUserToTeamWithContext adds a user to a team.
func (c *Client) AddUserToTeamWithContext(ctx context.Context, o AddUserToTeamOptions) error {
_, err := c.put(ctx, "/teams/"+o.TeamID+"/users/"+o.UserID, o, nil)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The diff section above this comment was inspired by #262.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this approach.

Copy link
Contributor

@stmcallister stmcallister left a comment

Choose a reason for hiding this comment

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

Looks good! 👍


// AddUserToTeamWithContext adds a user to a team.
func (c *Client) AddUserToTeamWithContext(ctx context.Context, o AddUserToTeamOptions) error {
_, err := c.put(ctx, "/teams/"+o.TeamID+"/users/"+o.UserID, o, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this approach.

@stmcallister stmcallister merged commit ae501db into master Mar 17, 2021
@stmcallister stmcallister deleted the ctx_team branch March 17, 2021 22:28
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