diff options
Diffstat (limited to 'vendor/github.com/nlopes/slack/slack.go')
-rw-r--r-- | vendor/github.com/nlopes/slack/slack.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/github.com/nlopes/slack/slack.go b/vendor/github.com/nlopes/slack/slack.go index eb686354..a13bed31 100644 --- a/vendor/github.com/nlopes/slack/slack.go +++ b/vendor/github.com/nlopes/slack/slack.go @@ -1,6 +1,7 @@ package slack import ( + "context" "errors" "log" "net/url" @@ -54,8 +55,13 @@ func New(token string) *Client { // AuthTest tests if the user is able to do authenticated requests or not func (api *Client) AuthTest() (response *AuthTestResponse, error error) { + return api.AuthTestContext(context.Background()) +} + +// AuthTestContext tests if the user is able to do authenticated requests or not with a custom context +func (api *Client) AuthTestContext(ctx context.Context) (response *AuthTestResponse, error error) { responseFull := &authTestResponseFull{} - err := post("auth.test", url.Values{"token": {api.config.token}}, responseFull, api.debug) + err := post(ctx, "auth.test", url.Values{"token": {api.config.token}}, responseFull, api.debug) if err != nil { return nil, err } @@ -71,7 +77,7 @@ func (api *Client) AuthTest() (response *AuthTestResponse, error error) { func (api *Client) SetDebug(debug bool) { api.debug = debug if debug && logger == nil { - logger = log.New(os.Stdout, "nlopes/slack", log.LstdFlags | log.Lshortfile) + logger = log.New(os.Stdout, "nlopes/slack", log.LstdFlags|log.Lshortfile) } } |