diff --git a/pkg/services/annotations/annotationsimpl/xorm_store_test.go b/pkg/services/annotations/annotationsimpl/xorm_store_test.go index cb752e988ce..2ae6f10ba82 100644 --- a/pkg/services/annotations/annotationsimpl/xorm_store_test.go +++ b/pkg/services/annotations/annotationsimpl/xorm_store_test.go @@ -7,7 +7,6 @@ import ( "testing" "time" - "github.com/grafana/grafana/pkg/services/sqlstore" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -20,6 +19,7 @@ import ( dashboardstore "github.com/grafana/grafana/pkg/services/dashboards/database" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/quota/quotatest" + "github.com/grafana/grafana/pkg/services/sqlstore" "github.com/grafana/grafana/pkg/services/tag/tagimpl" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/services/cleanup/cleanup_test.go b/pkg/services/cleanup/cleanup_test.go index 8d92c28d8f4..4db896a207d 100644 --- a/pkg/services/cleanup/cleanup_test.go +++ b/pkg/services/cleanup/cleanup_test.go @@ -4,8 +4,9 @@ import ( "testing" "time" - "github.com/grafana/grafana/pkg/setting" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/setting" ) func TestCleanUpTmpFiles(t *testing.T) { diff --git a/pkg/services/comments/sql_storage_test.go b/pkg/services/comments/sql_storage_test.go index 145a2cec5f3..4c8a01a1a24 100644 --- a/pkg/services/comments/sql_storage_test.go +++ b/pkg/services/comments/sql_storage_test.go @@ -5,10 +5,10 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/services/comments/commentmodel" - - "github.com/stretchr/testify/require" ) func createSqlStorage(t *testing.T) Storage { diff --git a/pkg/services/contexthandler/contexthandler_test.go b/pkg/services/contexthandler/contexthandler_test.go index 870222a6884..efdb5ccb275 100644 --- a/pkg/services/contexthandler/contexthandler_test.go +++ b/pkg/services/contexthandler/contexthandler_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/grafana/grafana-plugin-sdk-go/backend/gtime" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/grafana/grafana-plugin-sdk-go/backend/gtime" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/auth" "github.com/grafana/grafana/pkg/services/auth/authtest" diff --git a/pkg/services/contexthandler/model/model.go b/pkg/services/contexthandler/model/model.go index 0ae7d23c3b9..58c874a2193 100644 --- a/pkg/services/contexthandler/model/model.go +++ b/pkg/services/contexthandler/model/model.go @@ -5,6 +5,8 @@ import ( "net/http" "strings" + "github.com/prometheus/client_golang/prometheus" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/models/usertoken" @@ -13,7 +15,6 @@ import ( "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util/errutil" "github.com/grafana/grafana/pkg/web" - "github.com/prometheus/client_golang/prometheus" ) type ReqContext struct { diff --git a/pkg/services/contexthandler/model/model_test.go b/pkg/services/contexthandler/model/model_test.go index aa492d30999..151236e4247 100644 --- a/pkg/services/contexthandler/model/model_test.go +++ b/pkg/services/contexthandler/model/model_test.go @@ -4,8 +4,9 @@ import ( "net/http" "testing" - "github.com/grafana/grafana/pkg/web" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/web" ) func TestQueryBoolWithDefault(t *testing.T) { diff --git a/pkg/services/correlations/api.go b/pkg/services/correlations/api.go index 773236a6eb6..a654d3c9bc7 100644 --- a/pkg/services/correlations/api.go +++ b/pkg/services/correlations/api.go @@ -10,7 +10,6 @@ import ( ac "github.com/grafana/grafana/pkg/services/accesscontrol" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/services/datasources" - "github.com/grafana/grafana/pkg/web" ) diff --git a/pkg/services/correlations/correlations.go b/pkg/services/correlations/correlations.go index ed6da7b6fe1..2afdde08361 100644 --- a/pkg/services/correlations/correlations.go +++ b/pkg/services/correlations/correlations.go @@ -6,7 +6,6 @@ import ( "github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/events" - "github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/accesscontrol" diff --git a/pkg/services/dashboardimport/api/api_test.go b/pkg/services/dashboardimport/api/api_test.go index 6d5a07b8862..4752f4c27ff 100644 --- a/pkg/services/dashboardimport/api/api_test.go +++ b/pkg/services/dashboardimport/api/api_test.go @@ -7,6 +7,8 @@ import ( "net/http" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/components/simplejson" acmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock" @@ -15,7 +17,6 @@ import ( "github.com/grafana/grafana/pkg/services/quota" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/web/webtest" - "github.com/stretchr/testify/require" ) func TestImportDashboardAPI(t *testing.T) { diff --git a/pkg/services/dashboardimport/service/service_test.go b/pkg/services/dashboardimport/service/service_test.go index f3086f2a863..c0c14d601e2 100644 --- a/pkg/services/dashboardimport/service/service_test.go +++ b/pkg/services/dashboardimport/service/service_test.go @@ -6,6 +6,8 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/services/dashboardimport" "github.com/grafana/grafana/pkg/services/dashboards" @@ -15,7 +17,6 @@ import ( "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/plugindashboards" "github.com/grafana/grafana/pkg/services/user" - "github.com/stretchr/testify/require" ) func TestImportDashboardService(t *testing.T) { diff --git a/pkg/services/dashboardimport/utils/dash_template_evaluator_test.go b/pkg/services/dashboardimport/utils/dash_template_evaluator_test.go index 9d6053228a4..0fe2a3d09a5 100644 --- a/pkg/services/dashboardimport/utils/dash_template_evaluator_test.go +++ b/pkg/services/dashboardimport/utils/dash_template_evaluator_test.go @@ -3,9 +3,10 @@ package utils import ( "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/services/dashboardimport" - "github.com/stretchr/testify/require" ) func TestDashTemplateEvaluator(t *testing.T) { diff --git a/pkg/services/dashboards/dashboard_service_mock.go b/pkg/services/dashboards/dashboard_service_mock.go index 3da367b22be..a59d811dbbe 100644 --- a/pkg/services/dashboards/dashboard_service_mock.go +++ b/pkg/services/dashboards/dashboard_service_mock.go @@ -5,8 +5,9 @@ package dashboards import ( context "context" - folder "github.com/grafana/grafana/pkg/services/folder" mock "github.com/stretchr/testify/mock" + + folder "github.com/grafana/grafana/pkg/services/folder" ) // FakeDashboardService is an autogenerated mock type for the DashboardService type diff --git a/pkg/services/dashboards/folder_store_mock.go b/pkg/services/dashboards/folder_store_mock.go index df548e85efb..47fdf2baa87 100644 --- a/pkg/services/dashboards/folder_store_mock.go +++ b/pkg/services/dashboards/folder_store_mock.go @@ -5,8 +5,9 @@ package dashboards import ( context "context" - folder "github.com/grafana/grafana/pkg/services/folder" mock "github.com/stretchr/testify/mock" + + folder "github.com/grafana/grafana/pkg/services/folder" ) // FakeFolderStore is an autogenerated mock type for the FolderStore type diff --git a/pkg/services/dashboards/models_test.go b/pkg/services/dashboards/models_test.go index 9a6299997a4..b7ba915324b 100644 --- a/pkg/services/dashboards/models_test.go +++ b/pkg/services/dashboards/models_test.go @@ -3,11 +3,12 @@ package dashboards import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/infra/slugify" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestGetDashboardUrl(t *testing.T) { diff --git a/pkg/services/dashboards/store_mock.go b/pkg/services/dashboards/store_mock.go index f32268a86ce..4b2b5a9bded 100644 --- a/pkg/services/dashboards/store_mock.go +++ b/pkg/services/dashboards/store_mock.go @@ -5,11 +5,10 @@ package dashboards import ( context "context" - folder "github.com/grafana/grafana/pkg/services/folder" mock "github.com/stretchr/testify/mock" models "github.com/grafana/grafana/pkg/services/alerting/models" - + folder "github.com/grafana/grafana/pkg/services/folder" quota "github.com/grafana/grafana/pkg/services/quota" ) diff --git a/pkg/services/encryption/provider/cipher_aescfb_test.go b/pkg/services/encryption/provider/cipher_aescfb_test.go index d717381590f..ff067781ca8 100644 --- a/pkg/services/encryption/provider/cipher_aescfb_test.go +++ b/pkg/services/encryption/provider/cipher_aescfb_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) diff --git a/pkg/services/encryption/provider/decipher_aes_test.go b/pkg/services/encryption/provider/decipher_aes_test.go index b31958e8886..5dbe9142c66 100644 --- a/pkg/services/encryption/provider/decipher_aes_test.go +++ b/pkg/services/encryption/provider/decipher_aes_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" - "github.com/grafana/grafana/pkg/services/encryption" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/services/encryption" ) func Test_aesDecipher(t *testing.T) { diff --git a/pkg/services/encryption/service/helpers.go b/pkg/services/encryption/service/helpers.go index d32c1600d94..bbd1b5850f1 100644 --- a/pkg/services/encryption/service/helpers.go +++ b/pkg/services/encryption/service/helpers.go @@ -3,10 +3,11 @@ package service import ( "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/usagestats" encryptionprovider "github.com/grafana/grafana/pkg/services/encryption/provider" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" ) func SetupTestService(tb testing.TB) *Service { diff --git a/pkg/services/encryption/service/service_test.go b/pkg/services/encryption/service/service_test.go index e4850724699..6e0a58d40d8 100644 --- a/pkg/services/encryption/service/service_test.go +++ b/pkg/services/encryption/service/service_test.go @@ -4,12 +4,13 @@ import ( "context" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/usagestats" "github.com/grafana/grafana/pkg/services/encryption" "github.com/grafana/grafana/pkg/services/encryption/provider" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func Test_Service(t *testing.T) { diff --git a/pkg/services/folder/folderimpl/folder.go b/pkg/services/folder/folderimpl/folder.go index f7dfb2e3266..0ac9918b47b 100644 --- a/pkg/services/folder/folderimpl/folder.go +++ b/pkg/services/folder/folderimpl/folder.go @@ -15,14 +15,13 @@ import ( "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/folder" - "github.com/grafana/grafana/pkg/services/sqlstore" - "github.com/grafana/grafana/pkg/services/sqlstore/migrator" - "github.com/grafana/grafana/pkg/util" - "github.com/grafana/grafana/pkg/services/guardian" "github.com/grafana/grafana/pkg/services/org" + "github.com/grafana/grafana/pkg/services/sqlstore" + "github.com/grafana/grafana/pkg/services/sqlstore/migrator" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" + "github.com/grafana/grafana/pkg/util" ) type Service struct { diff --git a/pkg/services/folder/folderimpl/sqlstore.go b/pkg/services/folder/folderimpl/sqlstore.go index 40797519ee9..4e7767d745d 100644 --- a/pkg/services/folder/folderimpl/sqlstore.go +++ b/pkg/services/folder/folderimpl/sqlstore.go @@ -8,6 +8,7 @@ import ( "github.com/VividCortex/mysqlerr" "github.com/go-sql-driver/mysql" + "github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/slugify" diff --git a/pkg/services/grpcserver/health.go b/pkg/services/grpcserver/health.go index c00b3e3cd48..b7ef28f10ae 100644 --- a/pkg/services/grpcserver/health.go +++ b/pkg/services/grpcserver/health.go @@ -3,10 +3,10 @@ package grpcserver import ( "context" - "github.com/grafana/grafana/pkg/setting" - "google.golang.org/grpc/health" "google.golang.org/grpc/health/grpc_health_v1" + + "github.com/grafana/grafana/pkg/setting" ) // HealthService implements GRPC Health Checking Protocol: diff --git a/pkg/services/grpcserver/interceptors/auth.go b/pkg/services/grpcserver/interceptors/auth.go index fc25c51b019..f5f7d25e87a 100644 --- a/pkg/services/grpcserver/interceptors/auth.go +++ b/pkg/services/grpcserver/interceptors/auth.go @@ -4,6 +4,10 @@ import ( "context" "strings" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + apikeygenprefix "github.com/grafana/grafana/pkg/components/apikeygenprefixed" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/accesscontrol" @@ -11,10 +15,6 @@ import ( grpccontext "github.com/grafana/grafana/pkg/services/grpcserver/context" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/user" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" ) type Authenticator interface { diff --git a/pkg/services/grpcserver/interceptors/auth_test.go b/pkg/services/grpcserver/interceptors/auth_test.go index bc1dacd5541..785e3e4ec86 100644 --- a/pkg/services/grpcserver/interceptors/auth_test.go +++ b/pkg/services/grpcserver/interceptors/auth_test.go @@ -4,6 +4,9 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/metadata" + apikeygenprefix "github.com/grafana/grafana/pkg/components/apikeygenprefixed" "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/services/accesscontrol" @@ -12,8 +15,6 @@ import ( grpccontext "github.com/grafana/grafana/pkg/services/grpcserver/context" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/user" - "github.com/stretchr/testify/require" - "google.golang.org/grpc/metadata" ) func TestAuthenticator_Authenticate(t *testing.T) { diff --git a/pkg/services/grpcserver/interceptors/tracing.go b/pkg/services/grpcserver/interceptors/tracing.go index ccf805ddad7..9f9fa15f4b5 100644 --- a/pkg/services/grpcserver/interceptors/tracing.go +++ b/pkg/services/grpcserver/interceptors/tracing.go @@ -3,8 +3,9 @@ package interceptors import ( "context" - "github.com/grafana/grafana/pkg/infra/tracing" "google.golang.org/grpc" + + "github.com/grafana/grafana/pkg/infra/tracing" ) const tracingPrefix = "gRPC Server " diff --git a/pkg/services/grpcserver/reflection.go b/pkg/services/grpcserver/reflection.go index 3a4ecd09fe4..2a2751ddeed 100644 --- a/pkg/services/grpcserver/reflection.go +++ b/pkg/services/grpcserver/reflection.go @@ -3,10 +3,10 @@ package grpcserver import ( "context" - "github.com/grafana/grafana/pkg/setting" - "google.golang.org/grpc/reflection" "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" + + "github.com/grafana/grafana/pkg/setting" ) // ReflectionService implements the gRPC Server Reflection Protocol: diff --git a/pkg/services/grpcserver/service.go b/pkg/services/grpcserver/service.go index c7349a48954..bf267fb420e 100644 --- a/pkg/services/grpcserver/service.go +++ b/pkg/services/grpcserver/service.go @@ -6,17 +6,17 @@ import ( "net" "github.com/grafana/grafana-plugin-sdk-go/backend" + grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" + grpcAuth "github.com/grpc-ecosystem/go-grpc-middleware/auth" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/registry" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/grpcserver/interceptors" "github.com/grafana/grafana/pkg/setting" - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - grpcAuth "github.com/grpc-ecosystem/go-grpc-middleware/auth" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" ) type Provider interface { diff --git a/pkg/services/navtree/navtreeimpl/applinks_test.go b/pkg/services/navtree/navtreeimpl/applinks_test.go index 2864a5fa9c8..32727630992 100644 --- a/pkg/services/navtree/navtreeimpl/applinks_test.go +++ b/pkg/services/navtree/navtreeimpl/applinks_test.go @@ -4,6 +4,8 @@ import ( "net/http" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/models/roletype" "github.com/grafana/grafana/pkg/plugins" @@ -18,7 +20,6 @@ import ( "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/web" - "github.com/stretchr/testify/require" ) func TestAddAppLinks(t *testing.T) { diff --git a/pkg/services/notifications/codes_test.go b/pkg/services/notifications/codes_test.go index 515a31b734d..fbcfce51e19 100644 --- a/pkg/services/notifications/codes_test.go +++ b/pkg/services/notifications/codes_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" - - "github.com/stretchr/testify/require" ) func TestTimeLimitCodes(t *testing.T) { diff --git a/pkg/services/notifications/send_email_integration_test.go b/pkg/services/notifications/send_email_integration_test.go index 99f0cee48ab..482848f03b5 100644 --- a/pkg/services/notifications/send_email_integration_test.go +++ b/pkg/services/notifications/send_email_integration_test.go @@ -5,9 +5,9 @@ import ( "os" "testing" - "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/setting" ) func TestEmailIntegrationTest(t *testing.T) { diff --git a/pkg/services/notifications/smtp.go b/pkg/services/notifications/smtp.go index 175f4e8dc13..c012a11d5c0 100644 --- a/pkg/services/notifications/smtp.go +++ b/pkg/services/notifications/smtp.go @@ -8,8 +8,9 @@ import ( "strconv" "strings" - "github.com/grafana/grafana/pkg/setting" gomail "gopkg.in/mail.v2" + + "github.com/grafana/grafana/pkg/setting" ) type SmtpClient struct { diff --git a/pkg/services/notifications/smtp_test.go b/pkg/services/notifications/smtp_test.go index 8ca5a11ed5d..fe2edd6cc6b 100644 --- a/pkg/services/notifications/smtp_test.go +++ b/pkg/services/notifications/smtp_test.go @@ -5,9 +5,10 @@ import ( "strings" "testing" - "github.com/grafana/grafana/pkg/setting" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/setting" ) func TestBuildMail(t *testing.T) { diff --git a/pkg/services/org/orgimpl/org_test.go b/pkg/services/org/orgimpl/org_test.go index 206e6d2c016..952a96fab88 100644 --- a/pkg/services/org/orgimpl/org_test.go +++ b/pkg/services/org/orgimpl/org_test.go @@ -4,10 +4,11 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/quota" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" ) func TestOrgService(t *testing.T) { diff --git a/pkg/services/plugindashboards/service/service_test.go b/pkg/services/plugindashboards/service/service_test.go index 2349602ebdc..6cfed39d71f 100644 --- a/pkg/services/plugindashboards/service/service_test.go +++ b/pkg/services/plugindashboards/service/service_test.go @@ -8,12 +8,13 @@ import ( "sort" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/plugins/manager/dashboards" dashmodels "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/plugindashboards" - "github.com/stretchr/testify/require" ) func TestGetPluginDashboards(t *testing.T) { diff --git a/pkg/services/provisioning/alerting/config_reader.go b/pkg/services/provisioning/alerting/config_reader.go index 489e5b5776b..b6ca9d2c3dd 100644 --- a/pkg/services/provisioning/alerting/config_reader.go +++ b/pkg/services/provisioning/alerting/config_reader.go @@ -8,8 +8,9 @@ import ( "path/filepath" "strings" - "github.com/grafana/grafana/pkg/infra/log" "gopkg.in/yaml.v3" + + "github.com/grafana/grafana/pkg/infra/log" ) type rulesConfigReader struct { diff --git a/pkg/services/provisioning/alerting/config_reader_test.go b/pkg/services/provisioning/alerting/config_reader_test.go index f17cc3a8b61..edcf431e690 100644 --- a/pkg/services/provisioning/alerting/config_reader_test.go +++ b/pkg/services/provisioning/alerting/config_reader_test.go @@ -4,8 +4,9 @@ import ( "context" "testing" - "github.com/grafana/grafana/pkg/infra/log" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/infra/log" ) const ( diff --git a/pkg/services/provisioning/alerting/contact_point_types_test.go b/pkg/services/provisioning/alerting/contact_point_types_test.go index 34141f0949e..57ef9acfca0 100644 --- a/pkg/services/provisioning/alerting/contact_point_types_test.go +++ b/pkg/services/provisioning/alerting/contact_point_types_test.go @@ -3,9 +3,10 @@ package alerting import ( "testing" - "github.com/grafana/grafana/pkg/services/provisioning/values" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" + + "github.com/grafana/grafana/pkg/services/provisioning/values" ) func TestReceivers(t *testing.T) { diff --git a/pkg/services/provisioning/alerting/file/rules_types.go b/pkg/services/provisioning/alerting/file/rules_types.go index 3c726dffc41..8c31876a805 100644 --- a/pkg/services/provisioning/alerting/file/rules_types.go +++ b/pkg/services/provisioning/alerting/file/rules_types.go @@ -7,10 +7,10 @@ import ( "strings" "time" + "github.com/prometheus/common/model" + "github.com/grafana/grafana/pkg/services/ngalert/models" "github.com/grafana/grafana/pkg/services/provisioning/values" - - "github.com/prometheus/common/model" ) type RuleDelete struct { diff --git a/pkg/services/provisioning/alerting/notification_policy_types_test.go b/pkg/services/provisioning/alerting/notification_policy_types_test.go index d281427e5a6..15080a154f3 100644 --- a/pkg/services/provisioning/alerting/notification_policy_types_test.go +++ b/pkg/services/provisioning/alerting/notification_policy_types_test.go @@ -4,9 +4,8 @@ import ( "os" "testing" - "gopkg.in/yaml.v3" - "github.com/stretchr/testify/require" + "gopkg.in/yaml.v3" ) func TestNotificationPolicy(t *testing.T) { diff --git a/pkg/services/provisioning/dashboards/config_reader.go b/pkg/services/provisioning/dashboards/config_reader.go index a8aa1a06b3b..8d93c4de46b 100644 --- a/pkg/services/provisioning/dashboards/config_reader.go +++ b/pkg/services/provisioning/dashboards/config_reader.go @@ -8,10 +8,11 @@ import ( "path/filepath" "strings" + "gopkg.in/yaml.v3" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/provisioning/utils" - "gopkg.in/yaml.v3" ) type configReader struct { diff --git a/pkg/services/provisioning/dashboards/file_reader_symlink_test.go b/pkg/services/provisioning/dashboards/file_reader_symlink_test.go index 91b356e251a..b72425ea1c5 100644 --- a/pkg/services/provisioning/dashboards/file_reader_symlink_test.go +++ b/pkg/services/provisioning/dashboards/file_reader_symlink_test.go @@ -7,9 +7,10 @@ import ( "path/filepath" "testing" - "github.com/grafana/grafana/pkg/infra/log" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/infra/log" ) var ( diff --git a/pkg/services/provisioning/plugins/config_reader_test.go b/pkg/services/provisioning/plugins/config_reader_test.go index 497cca2c11c..3440c5848d7 100644 --- a/pkg/services/provisioning/plugins/config_reader_test.go +++ b/pkg/services/provisioning/plugins/config_reader_test.go @@ -5,9 +5,10 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/plugins" - "github.com/stretchr/testify/require" ) const ( diff --git a/pkg/services/provisioning/provisioning_test.go b/pkg/services/provisioning/provisioning_test.go index 4b18fab3310..e7626af9d37 100644 --- a/pkg/services/provisioning/provisioning_test.go +++ b/pkg/services/provisioning/provisioning_test.go @@ -6,12 +6,13 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + dashboardstore "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/provisioning/dashboards" "github.com/grafana/grafana/pkg/services/provisioning/utils" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/assert" ) func TestProvisioningServiceImpl(t *testing.T) { diff --git a/pkg/services/provisioning/values/values_test.go b/pkg/services/provisioning/values/values_test.go index 15954efd401..7ee470ec8ff 100644 --- a/pkg/services/provisioning/values/values_test.go +++ b/pkg/services/provisioning/values/values_test.go @@ -6,11 +6,12 @@ import ( "os" "testing" - "github.com/grafana/grafana/pkg/setting" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gopkg.in/ini.v1" "gopkg.in/yaml.v3" + + "github.com/grafana/grafana/pkg/setting" ) func TestValues(t *testing.T) { diff --git a/pkg/services/query/models.go b/pkg/services/query/models.go index 7e209923575..bb8bf8db6f0 100644 --- a/pkg/services/query/models.go +++ b/pkg/services/query/models.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/services/contexthandler" "github.com/grafana/grafana/pkg/services/datasources" diff --git a/pkg/services/queryhistory/queryhistory_create_test.go b/pkg/services/queryhistory/queryhistory_create_test.go index a04d967a64f..3e14f106890 100644 --- a/pkg/services/queryhistory/queryhistory_create_test.go +++ b/pkg/services/queryhistory/queryhistory_create_test.go @@ -3,8 +3,9 @@ package queryhistory import ( "testing" - "github.com/grafana/grafana/pkg/components/simplejson" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/components/simplejson" ) func TestIntegrationCreateQueryInQueryHistory(t *testing.T) { diff --git a/pkg/services/queryhistory/queryhistory_delete_stale_test.go b/pkg/services/queryhistory/queryhistory_delete_stale_test.go index 4d1a5e1a271..84ed7839572 100644 --- a/pkg/services/queryhistory/queryhistory_delete_stale_test.go +++ b/pkg/services/queryhistory/queryhistory_delete_stale_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - "github.com/grafana/grafana/pkg/web" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/web" ) func TestIntegrationDeleteStaleQueryFromQueryHistory(t *testing.T) { diff --git a/pkg/services/queryhistory/queryhistory_migrate_test.go b/pkg/services/queryhistory/queryhistory_migrate_test.go index dc4156dbc37..a8f5667eb25 100644 --- a/pkg/services/queryhistory/queryhistory_migrate_test.go +++ b/pkg/services/queryhistory/queryhistory_migrate_test.go @@ -5,8 +5,9 @@ import ( "testing" "time" - "github.com/grafana/grafana/pkg/components/simplejson" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/components/simplejson" ) func TestIntegrationMigrateQueriesToQueryHistory(t *testing.T) { diff --git a/pkg/services/queryhistory/queryhistory_patch_test.go b/pkg/services/queryhistory/queryhistory_patch_test.go index 14e0dabe37f..b9280367b1e 100644 --- a/pkg/services/queryhistory/queryhistory_patch_test.go +++ b/pkg/services/queryhistory/queryhistory_patch_test.go @@ -3,8 +3,9 @@ package queryhistory import ( "testing" - "github.com/grafana/grafana/pkg/web" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/web" ) func TestIntegrationPatchQueryCommentInQueryHistory(t *testing.T) { diff --git a/pkg/services/queryhistory/queryhistory_star_test.go b/pkg/services/queryhistory/queryhistory_star_test.go index a5fab3430c9..408435ef065 100644 --- a/pkg/services/queryhistory/queryhistory_star_test.go +++ b/pkg/services/queryhistory/queryhistory_star_test.go @@ -3,8 +3,9 @@ package queryhistory import ( "testing" - "github.com/grafana/grafana/pkg/web" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/web" ) func TestIntegrationStarQueryInQueryHistory(t *testing.T) { diff --git a/pkg/services/queryhistory/queryhistory_unstar_test.go b/pkg/services/queryhistory/queryhistory_unstar_test.go index eff47541fdc..0953a8f01d6 100644 --- a/pkg/services/queryhistory/queryhistory_unstar_test.go +++ b/pkg/services/queryhistory/queryhistory_unstar_test.go @@ -3,8 +3,9 @@ package queryhistory import ( "testing" - "github.com/grafana/grafana/pkg/web" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/web" ) func TestIntegrationUnstarQueryInQueryHistory(t *testing.T) { diff --git a/pkg/services/quota/quotaimpl/quota.go b/pkg/services/quota/quotaimpl/quota.go index 1eebaad635a..b4213fd10a5 100644 --- a/pkg/services/quota/quotaimpl/quota.go +++ b/pkg/services/quota/quotaimpl/quota.go @@ -4,12 +4,13 @@ import ( "context" "sync" + "golang.org/x/sync/errgroup" + "github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/infra/log" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/services/quota" "github.com/grafana/grafana/pkg/setting" - "golang.org/x/sync/errgroup" ) type serviceDisabled struct { diff --git a/pkg/services/rendering/mock.go b/pkg/services/rendering/mock.go index 6d5d0f33f92..6098d59e204 100644 --- a/pkg/services/rendering/mock.go +++ b/pkg/services/rendering/mock.go @@ -9,6 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" + models "github.com/grafana/grafana/pkg/models" ) diff --git a/pkg/services/rendering/rendering_test.go b/pkg/services/rendering/rendering_test.go index 6bb798638f1..0cb8edd2a8e 100644 --- a/pkg/services/rendering/rendering_test.go +++ b/pkg/services/rendering/rendering_test.go @@ -9,12 +9,13 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestGetUrl(t *testing.T) { diff --git a/pkg/services/search/service.go b/pkg/services/search/service.go index 8f45effe504..365516c33fe 100644 --- a/pkg/services/search/service.go +++ b/pkg/services/search/service.go @@ -5,12 +5,11 @@ import ( "sort" "github.com/grafana/grafana/pkg/infra/db" + "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/star" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" - - "github.com/grafana/grafana/pkg/models" ) func ProvideService(cfg *setting.Cfg, sqlstore db.DB, starService star.Service, dashboardService dashboards.DashboardService) *SearchService { diff --git a/pkg/services/secrets/kvstore/plugin_test.go b/pkg/services/secrets/kvstore/plugin_test.go index 19af6217f29..460adea650d 100644 --- a/pkg/services/secrets/kvstore/plugin_test.go +++ b/pkg/services/secrets/kvstore/plugin_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" - "github.com/grafana/grafana/pkg/plugins/backendplugin/secretsmanagerplugin" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/plugins/backendplugin/secretsmanagerplugin" ) // Set fatal flag to true, then simulate a plugin start failure diff --git a/pkg/services/secrets/manager/helpers.go b/pkg/services/secrets/manager/helpers.go index 967c909be33..e063c38046d 100644 --- a/pkg/services/secrets/manager/helpers.go +++ b/pkg/services/secrets/manager/helpers.go @@ -3,6 +3,9 @@ package manager import ( "testing" + "github.com/stretchr/testify/require" + "gopkg.in/ini.v1" + "github.com/grafana/grafana/pkg/infra/usagestats" encryptionprovider "github.com/grafana/grafana/pkg/services/encryption/provider" encryptionservice "github.com/grafana/grafana/pkg/services/encryption/service" @@ -10,8 +13,6 @@ import ( "github.com/grafana/grafana/pkg/services/kmsproviders/osskmsproviders" "github.com/grafana/grafana/pkg/services/secrets" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" - "gopkg.in/ini.v1" ) func SetupTestService(tb testing.TB, store secrets.Store) *SecretsService { diff --git a/pkg/services/secrets/manager/manager.go b/pkg/services/secrets/manager/manager.go index c9c5c2b9967..6e0180a2454 100644 --- a/pkg/services/secrets/manager/manager.go +++ b/pkg/services/secrets/manager/manager.go @@ -11,6 +11,9 @@ import ( "sync" "time" + "github.com/prometheus/client_golang/prometheus" + "golang.org/x/sync/errgroup" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/usagestats" "github.com/grafana/grafana/pkg/services/encryption" @@ -19,9 +22,6 @@ import ( "github.com/grafana/grafana/pkg/services/secrets" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/util" - - "github.com/prometheus/client_golang/prometheus" - "golang.org/x/sync/errgroup" ) const ( diff --git a/pkg/services/secrets/manager/metrics.go b/pkg/services/secrets/manager/metrics.go index b435f71036d..669d4c7a1cc 100644 --- a/pkg/services/secrets/manager/metrics.go +++ b/pkg/services/secrets/manager/metrics.go @@ -1,9 +1,10 @@ package manager import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/grafana/grafana/pkg/infra/metrics" "github.com/grafana/grafana/pkg/infra/metrics/metricutil" - "github.com/prometheus/client_golang/prometheus" ) const ( diff --git a/pkg/services/sqlstore/logger.go b/pkg/services/sqlstore/logger.go index 850e10cd214..199a36f1d13 100644 --- a/pkg/services/sqlstore/logger.go +++ b/pkg/services/sqlstore/logger.go @@ -3,9 +3,9 @@ package sqlstore import ( "fmt" - glog "github.com/grafana/grafana/pkg/infra/log" - "xorm.io/core" + + glog "github.com/grafana/grafana/pkg/infra/log" ) type XormLogger struct { diff --git a/pkg/services/sqlstore/migrations/accesscontrol/action_migrator.go b/pkg/services/sqlstore/migrations/accesscontrol/action_migrator.go index 47de5f8fa30..b5c2ffffa3d 100644 --- a/pkg/services/sqlstore/migrations/accesscontrol/action_migrator.go +++ b/pkg/services/sqlstore/migrations/accesscontrol/action_migrator.go @@ -4,10 +4,10 @@ import ( "fmt" "strings" + "xorm.io/xorm" + "github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/sqlstore/migrator" - - "xorm.io/xorm" ) const ActionMigrationID = "RBAC action name migrator" diff --git a/pkg/services/sqlstore/migrations/accesscontrol/managed_permission_migrator.go b/pkg/services/sqlstore/migrations/accesscontrol/managed_permission_migrator.go index 2a2a285c2c0..87f742ed38c 100644 --- a/pkg/services/sqlstore/migrations/accesscontrol/managed_permission_migrator.go +++ b/pkg/services/sqlstore/migrations/accesscontrol/managed_permission_migrator.go @@ -12,13 +12,14 @@ import ( "strings" "time" + "golang.org/x/text/cases" + "golang.org/x/text/language" + "xorm.io/xorm" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/sqlstore/migrator" - "golang.org/x/text/cases" - "golang.org/x/text/language" - "xorm.io/xorm" ) const ManagedPermissionsMigrationID = "managed permissions migration" diff --git a/pkg/services/sqlstore/migrations/accesscontrol/test/ac_test.go b/pkg/services/sqlstore/migrations/accesscontrol/test/ac_test.go index 0501f62580c..0c5ae95ae3d 100644 --- a/pkg/services/sqlstore/migrations/accesscontrol/test/ac_test.go +++ b/pkg/services/sqlstore/migrations/accesscontrol/test/ac_test.go @@ -6,6 +6,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "xorm.io/xorm" "github.com/grafana/grafana/pkg/infra/log" @@ -19,9 +21,6 @@ import ( "github.com/grafana/grafana/pkg/services/team" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) type rawPermission struct { diff --git a/pkg/services/sqlstore/migrations/accesscontrol/test/action_migrator_test.go b/pkg/services/sqlstore/migrations/accesscontrol/test/action_migrator_test.go index c3d78009a8b..ff0f3174aa7 100644 --- a/pkg/services/sqlstore/migrations/accesscontrol/test/action_migrator_test.go +++ b/pkg/services/sqlstore/migrations/accesscontrol/test/action_migrator_test.go @@ -4,15 +4,15 @@ import ( "fmt" "testing" - "github.com/grafana/grafana/pkg/services/dashboards" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/accesscontrol" + "github.com/grafana/grafana/pkg/services/dashboards" acmig "github.com/grafana/grafana/pkg/services/sqlstore/migrations/accesscontrol" "github.com/grafana/grafana/pkg/services/sqlstore/migrator" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" ) func TestActionMigration(t *testing.T) { diff --git a/pkg/services/sqlstore/migrations/accesscontrol/test/managed_permission_migrator_test.go b/pkg/services/sqlstore/migrations/accesscontrol/test/managed_permission_migrator_test.go index e8dd6d728c6..94ce65f9ee7 100644 --- a/pkg/services/sqlstore/migrations/accesscontrol/test/managed_permission_migrator_test.go +++ b/pkg/services/sqlstore/migrations/accesscontrol/test/managed_permission_migrator_test.go @@ -6,13 +6,14 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "xorm.io/xorm" + "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/accesscontrol" acmig "github.com/grafana/grafana/pkg/services/sqlstore/migrations/accesscontrol" "github.com/grafana/grafana/pkg/services/sqlstore/migrator" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" - "xorm.io/xorm" ) type inheritanceTestCase struct { diff --git a/pkg/services/sqlstore/migrations/annotation_mig.go b/pkg/services/sqlstore/migrations/annotation_mig.go index f66a63f06c0..dd23ffea93d 100644 --- a/pkg/services/sqlstore/migrations/annotation_mig.go +++ b/pkg/services/sqlstore/migrations/annotation_mig.go @@ -1,8 +1,9 @@ package migrations import ( - . "github.com/grafana/grafana/pkg/services/sqlstore/migrator" "xorm.io/xorm" + + . "github.com/grafana/grafana/pkg/services/sqlstore/migrator" ) func addAnnotationMig(mg *Migrator) { diff --git a/pkg/services/sqlstore/migrations/external_alertmanagers.go b/pkg/services/sqlstore/migrations/external_alertmanagers.go index 781341f7b3f..3403dc50c3e 100644 --- a/pkg/services/sqlstore/migrations/external_alertmanagers.go +++ b/pkg/services/sqlstore/migrations/external_alertmanagers.go @@ -5,12 +5,13 @@ import ( "net/url" "time" + "xorm.io/xorm" + "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/sqlstore/migrations/ualert" "github.com/grafana/grafana/pkg/services/sqlstore/migrator" "github.com/grafana/grafana/pkg/util" - "xorm.io/xorm" ) func AddExternalAlertmanagerToDatasourceMigration(mg *migrator.Migrator) { diff --git a/pkg/services/sqlstore/migrations/temp_user.go b/pkg/services/sqlstore/migrations/temp_user.go index a4fd1072aa7..af60817f035 100644 --- a/pkg/services/sqlstore/migrations/temp_user.go +++ b/pkg/services/sqlstore/migrations/temp_user.go @@ -3,8 +3,9 @@ package migrations import ( "time" - . "github.com/grafana/grafana/pkg/services/sqlstore/migrator" "xorm.io/xorm" + + . "github.com/grafana/grafana/pkg/services/sqlstore/migrator" ) func addTempUserMigrations(mg *Migrator) { diff --git a/pkg/services/sqlstore/migrations/user_mig.go b/pkg/services/sqlstore/migrations/user_mig.go index 6c33849621c..6edf5161f47 100644 --- a/pkg/services/sqlstore/migrations/user_mig.go +++ b/pkg/services/sqlstore/migrations/user_mig.go @@ -3,9 +3,10 @@ package migrations import ( "fmt" + "xorm.io/xorm" + . "github.com/grafana/grafana/pkg/services/sqlstore/migrator" "github.com/grafana/grafana/pkg/util" - "xorm.io/xorm" ) func addUserMigrations(mg *Migrator) { diff --git a/pkg/services/sqlstore/migrator/postgres_dialect.go b/pkg/services/sqlstore/migrator/postgres_dialect.go index b29577e35f6..b996eabac75 100644 --- a/pkg/services/sqlstore/migrator/postgres_dialect.go +++ b/pkg/services/sqlstore/migrator/postgres_dialect.go @@ -9,7 +9,6 @@ import ( "github.com/golang-migrate/migrate/v4/database" "github.com/lib/pq" - "xorm.io/xorm" ) diff --git a/pkg/services/sqlstore/session.go b/pkg/services/sqlstore/session.go index cffd88231a0..062d166963f 100644 --- a/pkg/services/sqlstore/session.go +++ b/pkg/services/sqlstore/session.go @@ -7,11 +7,10 @@ import ( "reflect" "time" + "github.com/mattn/go-sqlite3" "go.opentelemetry.io/otel/attribute" "xorm.io/xorm" - "github.com/mattn/go-sqlite3" - "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/services/sqlstore/migrator" diff --git a/pkg/services/sqlstore/sqlstore_test.go b/pkg/services/sqlstore/sqlstore_test.go index d17ba44c9a0..b85c7dd77b0 100644 --- a/pkg/services/sqlstore/sqlstore_test.go +++ b/pkg/services/sqlstore/sqlstore_test.go @@ -5,8 +5,9 @@ import ( "net/url" "testing" - "github.com/grafana/grafana/pkg/setting" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/setting" ) type sqlStoreTest struct { diff --git a/pkg/services/tag/tagimpl/store_test.go b/pkg/services/tag/tagimpl/store_test.go index 0b865587ef5..3d631136d39 100644 --- a/pkg/services/tag/tagimpl/store_test.go +++ b/pkg/services/tag/tagimpl/store_test.go @@ -4,10 +4,10 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/db" "github.com/grafana/grafana/pkg/services/tag" - - "github.com/stretchr/testify/require" ) type getStore func(db.DB) store diff --git a/pkg/services/user/userimpl/user_test.go b/pkg/services/user/userimpl/user_test.go index 53f63e72940..4f3b87d23b4 100644 --- a/pkg/services/user/userimpl/user_test.go +++ b/pkg/services/user/userimpl/user_test.go @@ -5,6 +5,9 @@ import ( "errors" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/localcache" "github.com/grafana/grafana/pkg/models/roletype" "github.com/grafana/grafana/pkg/services/org" @@ -12,9 +15,6 @@ import ( "github.com/grafana/grafana/pkg/services/team/teamtest" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestUserService(t *testing.T) {