Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1132a3faf2 | |||
| 63305fe232 |
2 changed files with 5 additions and 1 deletions
2
go.mod
2
go.mod
|
|
@ -1,3 +1,3 @@
|
||||||
module git.baxters.nz/jeremy/webhook
|
module git.janksystems.org/jeremy/webhook
|
||||||
|
|
||||||
go 1.25.7
|
go 1.25.7
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,10 @@ func Execute(suffix, username, title, text string) (err error) {
|
||||||
resp, err := http.Post(baseURL + suffix, "application/json",
|
resp, err := http.Post(baseURL + suffix, "application/json",
|
||||||
strings.NewReader(string(body)))
|
strings.NewReader(string(body)))
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
||||||
err = errors.New(resp.Status)
|
err = errors.New(resp.Status)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue