summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/nlopes/slack/slack.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-07-16 14:29:46 +0200
committerWim <wim@42.be>2017-07-16 14:29:46 +0200
commitaec5e3d77b6e480d04dd8773723de62416a94919 (patch)
tree57ab269e6c46e62e61db04a9ca6fbb55e736519f /vendor/github.com/nlopes/slack/slack.go
parent335ddf8db543bf64522196e6928c3d10af64694c (diff)
downloadmatterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.tar.gz
matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.tar.bz2
matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.zip
Update vendor (nlopes/slack)
Diffstat (limited to 'vendor/github.com/nlopes/slack/slack.go')
-rw-r--r--vendor/github.com/nlopes/slack/slack.go10
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)
}
}