chore: remove golang.org/x/net/context in favor of stdlib (#47532) (#47558)

This PR removes golang.org context imports under pkg/services/* and replaces them with the stdlib context.

Closes #44178

(cherry picked from commit bda3dd24e4)

Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-04-11 09:08:36 -04:00
committed by GitHub
co-authored by Kristin Laemmert
parent 7a1e09631f
commit 9597cc68a7
2 changed files with 4 additions and 5 deletions
+2 -4
View File
@@ -11,8 +11,6 @@ import (
"net/http"
"time"
"golang.org/x/net/context/ctxhttp"
"github.com/grafana/grafana/pkg/util"
)
@@ -52,7 +50,7 @@ func (ns *NotificationService) sendWebRequestSync(ctx context.Context, webhook *
return fmt.Errorf("webhook only supports HTTP methods PUT or POST")
}
request, err := http.NewRequest(webhook.HttpMethod, webhook.Url, bytes.NewReader([]byte(webhook.Body)))
request, err := http.NewRequestWithContext(ctx, webhook.HttpMethod, webhook.Url, bytes.NewReader([]byte(webhook.Body)))
if err != nil {
return err
}
@@ -72,7 +70,7 @@ func (ns *NotificationService) sendWebRequestSync(ctx context.Context, webhook *
request.Header.Set(k, v)
}
resp, err := ctxhttp.Do(ctx, netClient, request)
resp, err := netClient.Do(request)
if err != nil {
return err
}
@@ -1,11 +1,12 @@
package notifiers
import (
"context"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/encryption"
"github.com/grafana/grafana/pkg/services/notifications"
"golang.org/x/net/context"
)
type Manager interface {