summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go')
-rw-r--r--vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go
index 71ec37d3..d3fa57ea 100644
--- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go
+++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go
@@ -26,7 +26,11 @@ type ListUserMemberships struct {
}
func (a *API) ListMembersOfTeam(teamName string) (res keybase1.TeamMembersDetails, err error) {
- apiInput := fmt.Sprintf(`{"method": "list-team-memberships", "params": {"options": {"team": "%s"}}}`, teamName)
+ teamNameEscaped, err := json.Marshal(teamName)
+ if err != nil {
+ return res, err
+ }
+ apiInput := fmt.Sprintf(`{"method": "list-team-memberships", "params": {"options": {"team": %s}}}`, teamNameEscaped)
cmd := a.runOpts.Command("team", "api")
cmd.Stdin = strings.NewReader(apiInput)
var stderr bytes.Buffer
@@ -51,7 +55,11 @@ func (a *API) ListMembersOfTeam(teamName string) (res keybase1.TeamMembersDetail
}
func (a *API) ListUserMemberships(username string) ([]keybase1.AnnotatedMemberInfo, error) {
- apiInput := fmt.Sprintf(`{"method": "list-user-memberships", "params": {"options": {"username": "%s"}}}`, username)
+ usernameEscaped, err := json.Marshal(username)
+ if err != nil {
+ return nil, err
+ }
+ apiInput := fmt.Sprintf(`{"method": "list-user-memberships", "params": {"options": {"username": %s}}}`, usernameEscaped)
cmd := a.runOpts.Command("team", "api")
cmd.Stdin = strings.NewReader(apiInput)
var stderr bytes.Buffer