Chore: Update tests and import orders in prometheus backend (#81732)

* use fmt instead of grafana-cli/log

* reorder imports

* reorder imports
This commit is contained in:
ismail simsek
2024-02-01 20:16:21 +01:00
committed by GitHub
parent 8fea101931
commit 372cf797d1
3 changed files with 8 additions and 6 deletions
+5 -5
View File
@@ -2,6 +2,7 @@ package client
import (
"context"
"fmt"
"io"
"net/http"
"testing"
@@ -10,7 +11,6 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
"github.com/grafana/grafana/pkg/tsdb/prometheus/models"
)
@@ -44,7 +44,7 @@ func TestClient(t *testing.T) {
defer func() {
if res != nil && res.Body != nil {
if err := res.Body.Close(); err != nil {
logger.Warn("Error", "err", err)
fmt.Println("Error", "err", err)
}
}
}()
@@ -68,7 +68,7 @@ func TestClient(t *testing.T) {
defer func() {
if res != nil && res.Body != nil {
if err := res.Body.Close(); err != nil {
logger.Warn("Error", "err", err)
fmt.Println("Error", "err", err)
}
}
}()
@@ -98,7 +98,7 @@ func TestClient(t *testing.T) {
defer func() {
if res != nil && res.Body != nil {
if err := res.Body.Close(); err != nil {
logger.Warn("Error", "err", err)
fmt.Println("Error", "err", err)
}
}
}()
@@ -125,7 +125,7 @@ func TestClient(t *testing.T) {
defer func() {
if res != nil && res.Body != nil {
if err := res.Body.Close(); err != nil {
logger.Warn("Error", "err", err)
fmt.Println("Error", "err", err)
}
}
}()
+1
View File
@@ -11,6 +11,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/grafana/grafana/pkg/tsdb/prometheus/kinds/dataquery"
"github.com/grafana/grafana/pkg/tsdb/prometheus/models"
)
@@ -14,9 +14,10 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/experimental"
"github.com/grafana/grafana/pkg/tsdb/prometheus/kinds/dataquery"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/tsdb/prometheus/kinds/dataquery"
"github.com/grafana/grafana/pkg/tsdb/prometheus/models"
)