shekhargulati / 52-technologies-in-2016

Let's learn a new technology every week. A new technology blog every Sunday in 2016.
https://shekhargulati.com/
MIT License
7.19k stars 597 forks source link

Week 29 : Golang + GitHub Status API + Slack Notifications #40

Open rominirani opened 7 years ago

rominirani commented 7 years ago

Please provide your feedback by posting a comment against this issue.

nosequeldeebee commented 7 years ago

This is a great post. I've really enjoyed experimenting with the Slack webhook. Some feedback:

In your raise function: other than for readability, I don't see an advantage to declaring separate variables for WebhookURL and postParams when SlackIncomingWebhookURL can simply be used in http.PostForm and Sprintf can be used when json.Marshal-ing the SlackMessage.

Also, is there a reason you've declared so many variables and constants globally? In my version of the program I moved the githubStatus declaration inside main.