summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-10-28 10:37:33 -0400
committerJoramWilander <jwawilander@gmail.com>2015-10-28 10:37:33 -0400
commit35d1ac80dd3f7d6b094c22e3454122aae3975d53 (patch)
tree78264d9b1312106446a47ec41e54f4e4ab9a69ce /api
parent2680b81568ca3f8eac1d5937f85085f1785eb84d (diff)
downloadchat-35d1ac80dd3f7d6b094c22e3454122aae3975d53.tar.gz
chat-35d1ac80dd3f7d6b094c22e3454122aae3975d53.tar.bz2
chat-35d1ac80dd3f7d6b094c22e3454122aae3975d53.zip
Pass in iter vars to closure properly
Diffstat (limited to 'api')
-rw-r--r--api/post.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/api/post.go b/api/post.go
index 79f84e04d..afc63e553 100644
--- a/api/post.go
+++ b/api/post.go
@@ -249,7 +249,7 @@ func handleWebhookEventsAndForget(c *Context, post *model.Post, team *model.Team
}
for _, hook := range relevantHooks {
- go func() {
+ go func(hook *model.OutgoingWebhook) {
p := url.Values{}
p.Set("token", hook.Token)
@@ -270,7 +270,7 @@ func handleWebhookEventsAndForget(c *Context, post *model.Post, team *model.Team
client := &http.Client{}
for _, url := range hook.CallbackURLs {
- go func() {
+ go func(url string) {
req, _ := http.NewRequest("POST", url, strings.NewReader(p.Encode()))
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("Accept", "application/json")
@@ -289,10 +289,10 @@ func handleWebhookEventsAndForget(c *Context, post *model.Post, team *model.Team
}
}
}
- }()
+ }(url)
}
- }()
+ }(hook)
}
}()