summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-03-01 21:09:23 +0100
committerGitHub <noreply@github.com>2020-03-01 21:09:23 +0100
commitd893421c7b2a5ceccac01600d976f3f7ba7ab780 (patch)
tree51a4634ec3adae31c578e3f2e774f238778b0628 /vendor/github.com/keybase/go-keybase-chat-bot/kbchat/team.go
parent250b3bb5795240d5ebdab5416ab99dbc41be734b (diff)
downloadmatterbridge-msglm-d893421c7b2a5ceccac01600d976f3f7ba7ab780.tar.gz
matterbridge-msglm-d893421c7b2a5ceccac01600d976f3f7ba7ab780.tar.bz2
matterbridge-msglm-d893421c7b2a5ceccac01600d976f3f7ba7ab780.zip
Update vendor keybase/go-keybase-chat-bot (#1019)
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.go20
1 files changed, 16 insertions, 4 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 0f9d9524..71ec37d3 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
@@ -1,8 +1,10 @@
package kbchat
import (
+ "bytes"
"encoding/json"
"fmt"
+ "log"
"strings"
"github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1"
@@ -27,13 +29,18 @@ func (a *API) ListMembersOfTeam(teamName string) (res keybase1.TeamMembersDetail
apiInput := fmt.Sprintf(`{"method": "list-team-memberships", "params": {"options": {"team": "%s"}}}`, teamName)
cmd := a.runOpts.Command("team", "api")
cmd.Stdin = strings.NewReader(apiInput)
- bytes, err := cmd.CombinedOutput()
+ var stderr bytes.Buffer
+ cmd.Stderr = &stderr
+ output, err := cmd.Output()
if err != nil {
return res, APIError{err}
}
+ if stderr.Len() != 0 {
+ log.Printf("ListMembersOfTeam error: %s", stderr.String())
+ }
members := ListTeamMembers{}
- err = json.Unmarshal(bytes, &members)
+ err = json.Unmarshal(output, &members)
if err != nil {
return res, UnmarshalError{err}
}
@@ -47,13 +54,18 @@ func (a *API) ListUserMemberships(username string) ([]keybase1.AnnotatedMemberIn
apiInput := fmt.Sprintf(`{"method": "list-user-memberships", "params": {"options": {"username": "%s"}}}`, username)
cmd := a.runOpts.Command("team", "api")
cmd.Stdin = strings.NewReader(apiInput)
- bytes, err := cmd.CombinedOutput()
+ var stderr bytes.Buffer
+ cmd.Stderr = &stderr
+ output, err := cmd.Output()
if err != nil {
return nil, APIError{err}
}
+ if stderr.Len() != 0 {
+ log.Printf("ListUserMemberships error: %s", stderr.String())
+ }
members := ListUserMemberships{}
- err = json.Unmarshal(bytes, &members)
+ err = json.Unmarshal(output, &members)
if err != nil {
return nil, UnmarshalError{err}
}