diff --git a/pkg/expr/classic/classic_test.go b/pkg/expr/classic/classic_test.go index de159f32f21..31ccdbe1425 100644 --- a/pkg/expr/classic/classic_test.go +++ b/pkg/expr/classic/classic_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + "github.com/grafana/grafana-plugin-sdk-go/data" "github.com/stretchr/testify/require" ptr "github.com/xorcare/pointer" - "github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana/pkg/expr/mathexp" ) diff --git a/pkg/expr/classic/evaluator_test.go b/pkg/expr/classic/evaluator_test.go index 4deb92491ad..6cad30ff646 100644 --- a/pkg/expr/classic/evaluator_test.go +++ b/pkg/expr/classic/evaluator_test.go @@ -3,9 +3,10 @@ package classic import ( "testing" - "github.com/grafana/grafana/pkg/expr/mathexp" "github.com/stretchr/testify/require" ptr "github.com/xorcare/pointer" + + "github.com/grafana/grafana/pkg/expr/mathexp" ) func TestThresholdEvaluator(t *testing.T) { diff --git a/pkg/expr/classic/reduce_test.go b/pkg/expr/classic/reduce_test.go index 98cb5e63718..f46798449ed 100644 --- a/pkg/expr/classic/reduce_test.go +++ b/pkg/expr/classic/reduce_test.go @@ -5,10 +5,10 @@ import ( "testing" "time" + "github.com/grafana/grafana-plugin-sdk-go/data" "github.com/stretchr/testify/require" ptr "github.com/xorcare/pointer" - "github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana/pkg/expr/mathexp" ) diff --git a/pkg/expr/graph.go b/pkg/expr/graph.go index 9e78e5e2f2e..1d9269d1f93 100644 --- a/pkg/expr/graph.go +++ b/pkg/expr/graph.go @@ -6,10 +6,10 @@ import ( "fmt" "time" - "github.com/grafana/grafana/pkg/expr/mathexp" - "gonum.org/v1/gonum/graph/simple" "gonum.org/v1/gonum/graph/topo" + + "github.com/grafana/grafana/pkg/expr/mathexp" ) // NodeType is the type of a DPNode. Currently either a expression command or datasource query. diff --git a/pkg/expr/nodes.go b/pkg/expr/nodes.go index ab23dabbae0..fca11ec45cb 100644 --- a/pkg/expr/nodes.go +++ b/pkg/expr/nodes.go @@ -8,14 +8,13 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/data" + "gonum.org/v1/gonum/graph/simple" "github.com/grafana/grafana/pkg/expr/classic" "github.com/grafana/grafana/pkg/expr/mathexp" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/plugins/adapters" "github.com/grafana/grafana/pkg/services/datasources" - - "gonum.org/v1/gonum/graph/simple" ) var ( diff --git a/pkg/tsdb/graphite/graphite_test.go b/pkg/tsdb/graphite/graphite_test.go index 88b2f677be9..12336433f39 100644 --- a/pkg/tsdb/graphite/graphite_test.go +++ b/pkg/tsdb/graphite/graphite_test.go @@ -14,9 +14,10 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/grafana/grafana/pkg/components/simplejson" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/components/simplejson" ) func TestFixIntervalFormat(t *testing.T) { diff --git a/pkg/tsdb/influxdb/flux/executor_test.go b/pkg/tsdb/influxdb/flux/executor_test.go index 937f825eb1f..0bb8398d666 100644 --- a/pkg/tsdb/influxdb/flux/executor_test.go +++ b/pkg/tsdb/influxdb/flux/executor_test.go @@ -14,15 +14,14 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/experimental" + influxdb2 "github.com/influxdata/influxdb-client-go/v2" + "github.com/influxdata/influxdb-client-go/v2/api" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/xorcare/pointer" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/tsdb/influxdb/models" - - influxdb2 "github.com/influxdata/influxdb-client-go/v2" - "github.com/influxdata/influxdb-client-go/v2/api" ) //-------------------------------------------------------------- diff --git a/pkg/tsdb/influxdb/flux/query_models.go b/pkg/tsdb/influxdb/flux/query_models.go index 8633229282c..3a97efeffdf 100644 --- a/pkg/tsdb/influxdb/flux/query_models.go +++ b/pkg/tsdb/influxdb/flux/query_models.go @@ -6,6 +6,7 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana/pkg/tsdb/influxdb/models" ) diff --git a/pkg/tsdb/influxdb/model_parser.go b/pkg/tsdb/influxdb/model_parser.go index 9b8930d0bd9..d33e2aec34c 100644 --- a/pkg/tsdb/influxdb/model_parser.go +++ b/pkg/tsdb/influxdb/model_parser.go @@ -6,6 +6,7 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana/pkg/components/simplejson" ) diff --git a/pkg/tsdb/influxdb/query.go b/pkg/tsdb/influxdb/query.go index abf160edd15..8ee02dda628 100644 --- a/pkg/tsdb/influxdb/query.go +++ b/pkg/tsdb/influxdb/query.go @@ -8,6 +8,7 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana/pkg/tsdb/intervalv2" ) diff --git a/pkg/tsdb/prometheus/azureauth/azure.go b/pkg/tsdb/prometheus/azureauth/azure.go index b80bfcf41cc..2bb7711ac82 100644 --- a/pkg/tsdb/prometheus/azureauth/azure.go +++ b/pkg/tsdb/prometheus/azureauth/azure.go @@ -10,8 +10,8 @@ import ( "github.com/grafana/grafana-azure-sdk-go/azsettings" "github.com/grafana/grafana-plugin-sdk-go/backend" sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" - "github.com/grafana/grafana/pkg/tsdb/prometheus/utils" + "github.com/grafana/grafana/pkg/tsdb/prometheus/utils" "github.com/grafana/grafana/pkg/util/maputil" ) diff --git a/pkg/tsdb/prometheus/azureauth/azure_test.go b/pkg/tsdb/prometheus/azureauth/azure_test.go index 8888c13cdec..e6037dfc09f 100644 --- a/pkg/tsdb/prometheus/azureauth/azure_test.go +++ b/pkg/tsdb/prometheus/azureauth/azure_test.go @@ -6,10 +6,10 @@ import ( "github.com/grafana/grafana-azure-sdk-go/azsettings" "github.com/grafana/grafana-plugin-sdk-go/backend" sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" - - "github.com/grafana/grafana/pkg/setting" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/setting" ) func TestConfigureAzureAuthentication(t *testing.T) { diff --git a/pkg/tsdb/prometheus/client/client.go b/pkg/tsdb/prometheus/client/client.go index d99d229509b..47a5969d373 100644 --- a/pkg/tsdb/prometheus/client/client.go +++ b/pkg/tsdb/prometheus/client/client.go @@ -12,6 +12,7 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana/pkg/tsdb/prometheus/models" ) diff --git a/pkg/tsdb/prometheus/client/client_test.go b/pkg/tsdb/prometheus/client/client_test.go index e9928909e93..920baf81dfb 100644 --- a/pkg/tsdb/prometheus/client/client_test.go +++ b/pkg/tsdb/prometheus/client/client_test.go @@ -8,9 +8,10 @@ import ( "time" "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" - "github.com/stretchr/testify/require" ) type MockDoer struct { diff --git a/pkg/tsdb/prometheus/client/transport.go b/pkg/tsdb/prometheus/client/transport.go index 5e4cccd1038..e74437efee0 100644 --- a/pkg/tsdb/prometheus/client/transport.go +++ b/pkg/tsdb/prometheus/client/transport.go @@ -6,6 +6,7 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/tsdb/prometheus/azureauth" diff --git a/pkg/tsdb/prometheus/client/transport_test.go b/pkg/tsdb/prometheus/client/transport_test.go index 945e0ada0dc..67f0e92b49d 100644 --- a/pkg/tsdb/prometheus/client/transport_test.go +++ b/pkg/tsdb/prometheus/client/transport_test.go @@ -5,9 +5,10 @@ import ( "github.com/grafana/grafana-azure-sdk-go/azsettings" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/log/logtest" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" ) func TestCreateTransportOptions(t *testing.T) { diff --git a/pkg/tsdb/prometheus/middleware/custom_query_params.go b/pkg/tsdb/prometheus/middleware/custom_query_params.go index b352c2f6a0d..88c9ceeb384 100644 --- a/pkg/tsdb/prometheus/middleware/custom_query_params.go +++ b/pkg/tsdb/prometheus/middleware/custom_query_params.go @@ -5,6 +5,7 @@ import ( "net/url" sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" + "github.com/grafana/grafana/pkg/infra/log" ) diff --git a/pkg/tsdb/prometheus/middleware/custom_query_params_test.go b/pkg/tsdb/prometheus/middleware/custom_query_params_test.go index fd1e0e22e0a..b242add37a5 100644 --- a/pkg/tsdb/prometheus/middleware/custom_query_params_test.go +++ b/pkg/tsdb/prometheus/middleware/custom_query_params_test.go @@ -7,8 +7,9 @@ import ( "testing" "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" - "github.com/grafana/grafana/pkg/infra/log" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/infra/log" ) func TestCustomQueryParametersMiddleware(t *testing.T) { diff --git a/pkg/tsdb/prometheus/middleware/force_http_get.go b/pkg/tsdb/prometheus/middleware/force_http_get.go index 89061609478..38fc8433607 100644 --- a/pkg/tsdb/prometheus/middleware/force_http_get.go +++ b/pkg/tsdb/prometheus/middleware/force_http_get.go @@ -4,6 +4,7 @@ import ( "net/http" sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" + "github.com/grafana/grafana/pkg/infra/log" ) diff --git a/pkg/tsdb/prometheus/middleware/force_http_get_test.go b/pkg/tsdb/prometheus/middleware/force_http_get_test.go index 21cadae7290..8eb96121dc0 100644 --- a/pkg/tsdb/prometheus/middleware/force_http_get_test.go +++ b/pkg/tsdb/prometheus/middleware/force_http_get_test.go @@ -5,8 +5,9 @@ import ( "testing" "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" - "github.com/grafana/grafana/pkg/infra/log" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/infra/log" ) func TestEnsureHttpMethodMiddleware(t *testing.T) { diff --git a/pkg/tsdb/prometheus/models/query.go b/pkg/tsdb/prometheus/models/query.go index e69bcb9b226..233d8fddc50 100644 --- a/pkg/tsdb/prometheus/models/query.go +++ b/pkg/tsdb/prometheus/models/query.go @@ -8,6 +8,7 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana/pkg/tsdb/intervalv2" ) diff --git a/pkg/tsdb/prometheus/models/query_test.go b/pkg/tsdb/prometheus/models/query_test.go index fc0efbcb123..dd30c5f0b24 100644 --- a/pkg/tsdb/prometheus/models/query_test.go +++ b/pkg/tsdb/prometheus/models/query_test.go @@ -6,9 +6,10 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/tsdb/intervalv2" "github.com/grafana/grafana/pkg/tsdb/prometheus/models" - "github.com/stretchr/testify/require" ) var ( diff --git a/pkg/tsdb/prometheus/prometheus.go b/pkg/tsdb/prometheus/prometheus.go index e03f7263733..cde81f9968f 100644 --- a/pkg/tsdb/prometheus/prometheus.go +++ b/pkg/tsdb/prometheus/prometheus.go @@ -10,6 +10,9 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/datasource" "github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt" + "github.com/patrickmn/go-cache" + apiv1 "github.com/prometheus/client_golang/api/prometheus/v1" + "github.com/grafana/grafana/pkg/infra/httpclient" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/tracing" @@ -18,8 +21,6 @@ import ( "github.com/grafana/grafana/pkg/tsdb/prometheus/client" "github.com/grafana/grafana/pkg/tsdb/prometheus/querydata" "github.com/grafana/grafana/pkg/tsdb/prometheus/resource" - "github.com/patrickmn/go-cache" - apiv1 "github.com/prometheus/client_golang/api/prometheus/v1" ) var plog = log.New("tsdb.prometheus") diff --git a/pkg/tsdb/prometheus/prometheus_test.go b/pkg/tsdb/prometheus/prometheus_test.go index 5f9969ce237..ee2b9a1c289 100644 --- a/pkg/tsdb/prometheus/prometheus_test.go +++ b/pkg/tsdb/prometheus/prometheus_test.go @@ -10,10 +10,11 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/datasource" sdkHttpClient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/httpclient" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" ) type fakeSender struct{} diff --git a/pkg/tsdb/prometheus/querydata/exemplar/sampler_stddev_test.go b/pkg/tsdb/prometheus/querydata/exemplar/sampler_stddev_test.go index 994abdd551c..b96f6d63b28 100644 --- a/pkg/tsdb/prometheus/querydata/exemplar/sampler_stddev_test.go +++ b/pkg/tsdb/prometheus/querydata/exemplar/sampler_stddev_test.go @@ -5,6 +5,7 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/experimental" + "github.com/grafana/grafana/pkg/tsdb/prometheus/models" "github.com/grafana/grafana/pkg/tsdb/prometheus/querydata/exemplar" ) diff --git a/pkg/tsdb/prometheus/querydata/exemplar/sampler_test.go b/pkg/tsdb/prometheus/querydata/exemplar/sampler_test.go index 3387b16e34b..f071f1b9025 100644 --- a/pkg/tsdb/prometheus/querydata/exemplar/sampler_test.go +++ b/pkg/tsdb/prometheus/querydata/exemplar/sampler_test.go @@ -5,6 +5,7 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/experimental" + "github.com/grafana/grafana/pkg/tsdb/prometheus/models" "github.com/grafana/grafana/pkg/tsdb/prometheus/querydata/exemplar" ) diff --git a/pkg/tsdb/prometheus/querydata/framing_bench_test.go b/pkg/tsdb/prometheus/querydata/framing_bench_test.go index dee98077e7d..7f319ea72da 100644 --- a/pkg/tsdb/prometheus/querydata/framing_bench_test.go +++ b/pkg/tsdb/prometheus/querydata/framing_bench_test.go @@ -15,8 +15,9 @@ import ( "time" "github.com/grafana/grafana-plugin-sdk-go/backend" - "github.com/grafana/grafana/pkg/tsdb/prometheus/models" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/tsdb/prometheus/models" ) // when memory-profiling this benchmark, these commands are recommended: diff --git a/pkg/tsdb/prometheus/querydata/framing_test.go b/pkg/tsdb/prometheus/querydata/framing_test.go index 40d96ea830d..09355702fc2 100644 --- a/pkg/tsdb/prometheus/querydata/framing_test.go +++ b/pkg/tsdb/prometheus/querydata/framing_test.go @@ -12,10 +12,9 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/experimental" + "github.com/stretchr/testify/require" "github.com/grafana/grafana/pkg/tsdb/prometheus/models" ) diff --git a/pkg/tsdb/prometheus/querydata/request_test.go b/pkg/tsdb/prometheus/querydata/request_test.go index 8005790781a..7ab268b4e7b 100644 --- a/pkg/tsdb/prometheus/querydata/request_test.go +++ b/pkg/tsdb/prometheus/querydata/request_test.go @@ -13,7 +13,6 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/grafana/grafana/pkg/tsdb/prometheus/client" apiv1 "github.com/prometheus/client_golang/api/prometheus/v1" p "github.com/prometheus/common/model" "github.com/stretchr/testify/require" @@ -22,6 +21,7 @@ import ( "github.com/grafana/grafana/pkg/infra/log/logtest" "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/setting" + "github.com/grafana/grafana/pkg/tsdb/prometheus/client" "github.com/grafana/grafana/pkg/tsdb/prometheus/models" "github.com/grafana/grafana/pkg/tsdb/prometheus/querydata" ) diff --git a/pkg/tsdb/prometheus/utils/utils.go b/pkg/tsdb/prometheus/utils/utils.go index 8930a214f91..a4e64c2819e 100644 --- a/pkg/tsdb/prometheus/utils/utils.go +++ b/pkg/tsdb/prometheus/utils/utils.go @@ -6,8 +6,9 @@ import ( "fmt" "github.com/grafana/grafana-plugin-sdk-go/backend" - "github.com/grafana/grafana/pkg/infra/tracing" "go.opentelemetry.io/otel/attribute" + + "github.com/grafana/grafana/pkg/infra/tracing" ) // GetJsonData just gets the json in easier to work with type. It's used on multiple places which isn't super effective