Skip to content

Commit

Permalink
Unshadow net/url package
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Pasquier <[email protected]>
  • Loading branch information
simonpasquier committed Jul 17, 2018
1 parent d9d0552 commit 6570755
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions notify/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,11 @@ func (n *PagerDuty) notifyV1(ctx context.Context, c *http.Client, eventType, key
Details: details,
}

url, err := url.Parse("https://events.pagerduty.com/generic/2010-04-15/create_event.json")
apiURL, err := url.Parse("https://events.pagerduty.com/generic/2010-04-15/create_event.json")
if err != nil {
return false, err
}
n.conf.URL = &config.URL{url}
n.conf.URL = &config.URL{apiURL}

if eventType == pagerDutyEventTrigger {
msg.Client = tmpl(n.conf.Client)
Expand Down Expand Up @@ -763,9 +763,9 @@ func (n *Hipchat) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
data = n.tmpl.Data(receiverName(ctx, n.logger), groupLabels(ctx, n.logger), as...)
tmplText = tmplText(n.tmpl, data, &err)
tmplHTML = tmplHTML(n.tmpl, data, &err)
url = *n.conf.APIURL
apiURL = *n.conf.APIURL
)
url.Path += fmt.Sprintf("v2/room/%s/notification?auth_token=%s", n.conf.RoomID, n.conf.AuthToken)
apiURL.Path += fmt.Sprintf("v2/room/%s/notification?auth_token=%s", n.conf.RoomID, n.conf.AuthToken)

if n.conf.MessageFormat == "html" {
msg = tmplHTML(n.conf.Message)
Expand Down Expand Up @@ -794,7 +794,7 @@ func (n *Hipchat) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
return false, err
}

resp, err := ctxhttp.Post(ctx, c, url.String(), contentTypeJSON, &buf)
resp, err := ctxhttp.Post(ctx, c, apiURL.String(), contentTypeJSON, &buf)
if err != nil {
return true, err
}
Expand Down

0 comments on commit 6570755

Please sign in to comment.