We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85ff16f commit 45ea6eeCopy full SHA for 45ea6ee
main.go
@@ -48,12 +48,14 @@ type discordOut struct {
48
49
func main() {
50
webhookUrl := os.Getenv("DISCORD_WEBHOOK")
51
- if webhookUrl == "" {
+ whURL := flag.String("webhook.url", webhookUrl, "")
52
+ flag.Parse()
53
+
54
+ if webhookUrl == "" && *whURL == "" {
55
fmt.Fprintf(os.Stderr, "error: environment variable DISCORD_WEBHOOK not found\n")
56
os.Exit(1)
57
}
- whURL := flag.String("webhook.url", webhookUrl, "")
- flag.Parse()
58
59
fmt.Fprintf(os.Stdout, "info: Listening on 0.0.0.0:9094\n")
60
http.ListenAndServe(":9094", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
61
b, err := ioutil.ReadAll(r.Body)
0 commit comments