diff --git a/pkg/api/admin_test.go b/pkg/api/admin_test.go index 8c63fbed185..04c69f4755b 100644 --- a/pkg/api/admin_test.go +++ b/pkg/api/admin_test.go @@ -5,10 +5,10 @@ import ( "net/http" "testing" - "github.com/grafana/grafana/pkg/infra/db/dbtest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/db/dbtest" "github.com/grafana/grafana/pkg/services/accesscontrol" "github.com/grafana/grafana/pkg/services/stats/statstest" "github.com/grafana/grafana/pkg/setting" diff --git a/pkg/api/avatar/avatar.go b/pkg/api/avatar/avatar.go index bcfe2eb77c6..d331cee8664 100644 --- a/pkg/api/avatar/avatar.go +++ b/pkg/api/avatar/avatar.go @@ -20,11 +20,12 @@ import ( "sync" "time" + gocache "github.com/patrickmn/go-cache" + "github.com/grafana/grafana/pkg/infra/log" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/web" - gocache "github.com/patrickmn/go-cache" ) const ( diff --git a/pkg/api/avatar/avatar_test.go b/pkg/api/avatar/avatar_test.go index abc98a59b77..916ba082e22 100644 --- a/pkg/api/avatar/avatar_test.go +++ b/pkg/api/avatar/avatar_test.go @@ -7,8 +7,9 @@ import ( "testing" "time" - "github.com/grafana/grafana/pkg/setting" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/setting" ) const DEFAULT_NONSENSE_HASH string = "9e107d9d372bb6826bd81d3542a419d6" diff --git a/pkg/api/datasources_test.go b/pkg/api/datasources_test.go index be708e89e6f..8eabf669b34 100644 --- a/pkg/api/datasources_test.go +++ b/pkg/api/datasources_test.go @@ -8,7 +8,6 @@ import ( "strings" "testing" - "github.com/grafana/grafana/pkg/web/webtest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -24,6 +23,7 @@ import ( "github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/datasources/permissions" "github.com/grafana/grafana/pkg/setting" + "github.com/grafana/grafana/pkg/web/webtest" ) const ( diff --git a/pkg/api/dtos/index.go b/pkg/api/dtos/index.go index 6d1263d0c1b..049a13f0425 100644 --- a/pkg/api/dtos/index.go +++ b/pkg/api/dtos/index.go @@ -1,10 +1,10 @@ package dtos import ( + "html/template" + "github.com/grafana/grafana/pkg/services/navtree" "github.com/grafana/grafana/pkg/setting" - - "html/template" ) type IndexViewData struct { diff --git a/pkg/api/dtos/models_test.go b/pkg/api/dtos/models_test.go index 931676f5a04..39dd133f2fe 100644 --- a/pkg/api/dtos/models_test.go +++ b/pkg/api/dtos/models_test.go @@ -4,10 +4,11 @@ import ( "sort" "testing" + "github.com/stretchr/testify/assert" + "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/assert" ) func TestGetUniqueDatasourceTypes(t *testing.T) { diff --git a/pkg/api/frontend_logging_test.go b/pkg/api/frontend_logging_test.go index 563ae9ecd7a..5771bb4465c 100644 --- a/pkg/api/frontend_logging_test.go +++ b/pkg/api/frontend_logging_test.go @@ -12,15 +12,15 @@ import ( "github.com/getsentry/sentry-go" "github.com/go-kit/log" "github.com/go-kit/log/level" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/api/frontendlogging" "github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/plugins" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" "github.com/grafana/grafana/pkg/setting" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) type SourceMapReadRecord struct { diff --git a/pkg/api/frontendlogging/sentry.go b/pkg/api/frontendlogging/sentry.go index 032bb874ef1..66b74c09c04 100644 --- a/pkg/api/frontendlogging/sentry.go +++ b/pkg/api/frontendlogging/sentry.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/getsentry/sentry-go" + "github.com/grafana/grafana/pkg/infra/log" ) diff --git a/pkg/api/frontendlogging/source_maps.go b/pkg/api/frontendlogging/source_maps.go index 09536c24e5b..95a4802a2ab 100644 --- a/pkg/api/frontendlogging/source_maps.go +++ b/pkg/api/frontendlogging/source_maps.go @@ -9,9 +9,9 @@ import ( "strings" "sync" + "github.com/getsentry/sentry-go" sourcemap "github.com/go-sourcemap/sourcemap" - "github.com/getsentry/sentry-go" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/setting" ) diff --git a/pkg/api/frontendsettings_test.go b/pkg/api/frontendsettings_test.go index 5569e30d4e2..07d3a4d1ab5 100644 --- a/pkg/api/frontendsettings_test.go +++ b/pkg/api/frontendsettings_test.go @@ -7,14 +7,14 @@ import ( "path/filepath" "testing" - "github.com/grafana/grafana/pkg/login/social" - "github.com/grafana/grafana/pkg/plugins/config" - "github.com/grafana/grafana/pkg/plugins/pluginscdn" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/grafana/grafana/pkg/infra/db" + "github.com/grafana/grafana/pkg/login/social" "github.com/grafana/grafana/pkg/plugins" + "github.com/grafana/grafana/pkg/plugins/config" + "github.com/grafana/grafana/pkg/plugins/pluginscdn" accesscontrolmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock" "github.com/grafana/grafana/pkg/services/featuremgmt" "github.com/grafana/grafana/pkg/services/licensing" diff --git a/pkg/api/health_test.go b/pkg/api/health_test.go index 699f85607af..96ab7e2612e 100644 --- a/pkg/api/health_test.go +++ b/pkg/api/health_test.go @@ -7,11 +7,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/infra/db/dbtest" "github.com/grafana/grafana/pkg/infra/localcache" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/web" - "github.com/stretchr/testify/require" ) func TestHealthAPI_Version(t *testing.T) { diff --git a/pkg/api/http_server_test.go b/pkg/api/http_server_test.go index c0d45258855..5cb99004bef 100644 --- a/pkg/api/http_server_test.go +++ b/pkg/api/http_server_test.go @@ -3,8 +3,9 @@ package api import ( "testing" - "github.com/grafana/grafana/pkg/setting" "github.com/stretchr/testify/assert" + + "github.com/grafana/grafana/pkg/setting" ) func TestHTTPServer_MetricsBasicAuth(t *testing.T) { diff --git a/pkg/api/org_invite_test.go b/pkg/api/org_invite_test.go index ed20e17894c..8b8829d8512 100644 --- a/pkg/api/org_invite_test.go +++ b/pkg/api/org_invite_test.go @@ -5,15 +5,15 @@ import ( "strings" "testing" - "github.com/grafana/grafana/pkg/services/org/orgtest" - "github.com/grafana/grafana/pkg/setting" - "github.com/grafana/grafana/pkg/web/webtest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/grafana/grafana/pkg/services/accesscontrol" + "github.com/grafana/grafana/pkg/services/org/orgtest" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user/usertest" + "github.com/grafana/grafana/pkg/setting" + "github.com/grafana/grafana/pkg/web/webtest" ) func TestOrgInvitesAPIEndpoint_RBAC(t *testing.T) { diff --git a/pkg/api/plugin_dashboards_test.go b/pkg/api/plugin_dashboards_test.go index 2abafcd5365..ae3709ba39c 100644 --- a/pkg/api/plugin_dashboards_test.go +++ b/pkg/api/plugin_dashboards_test.go @@ -9,13 +9,14 @@ import ( "net/http" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/services/org" "github.com/grafana/grafana/pkg/services/plugindashboards" "github.com/grafana/grafana/pkg/services/quota/quotatest" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/web/webtest" - "github.com/stretchr/testify/require" ) func TestGetPluginDashboards(t *testing.T) { diff --git a/pkg/api/plugin_metrics.go b/pkg/api/plugin_metrics.go index 85379d05d52..e32a3ad29ab 100644 --- a/pkg/api/plugin_metrics.go +++ b/pkg/api/plugin_metrics.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana/pkg/plugins/backendplugin" "github.com/grafana/grafana/pkg/web" ) diff --git a/pkg/api/plugin_metrics_test.go b/pkg/api/plugin_metrics_test.go index 03acced669c..40d4f6f3921 100644 --- a/pkg/api/plugin_metrics_test.go +++ b/pkg/api/plugin_metrics_test.go @@ -7,12 +7,13 @@ import ( "testing" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/plugins" "github.com/grafana/grafana/pkg/plugins/backendplugin" "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/web/webtest" - "github.com/stretchr/testify/require" ) func TestPluginMetricsEndpoint(t *testing.T) { diff --git a/pkg/api/plugin_resource_test.go b/pkg/api/plugin_resource_test.go index a63e9485264..5b5944c8d3f 100644 --- a/pkg/api/plugin_resource_test.go +++ b/pkg/api/plugin_resource_test.go @@ -9,10 +9,9 @@ import ( "strings" "testing" - "github.com/stretchr/testify/require" - "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/db" "github.com/grafana/grafana/pkg/infra/localcache" diff --git a/pkg/api/plugins_test.go b/pkg/api/plugins_test.go index fef5ceba31b..43765e56f51 100644 --- a/pkg/api/plugins_test.go +++ b/pkg/api/plugins_test.go @@ -12,13 +12,11 @@ import ( "strings" "testing" + "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" - "github.com/stretchr/testify/require" - "github.com/grafana/grafana-plugin-sdk-go/backend" - "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/log/logtest" diff --git a/pkg/api/response/response_test.go b/pkg/api/response/response_test.go index 67658cb497a..a100c42ae48 100644 --- a/pkg/api/response/response_test.go +++ b/pkg/api/response/response_test.go @@ -5,10 +5,10 @@ import ( "net/http" "testing" - "github.com/grafana/grafana/pkg/util/errutil" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/util/errutil" ) func TestErrors(t *testing.T) { diff --git a/pkg/api/short_url_test.go b/pkg/api/short_url_test.go index 17a4597958f..e84efbc9ce3 100644 --- a/pkg/api/short_url_test.go +++ b/pkg/api/short_url_test.go @@ -6,6 +6,8 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/api/routing" @@ -14,7 +16,6 @@ import ( "github.com/grafana/grafana/pkg/services/shorturls" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" - "github.com/stretchr/testify/require" ) func TestShortURLAPIEndpoint(t *testing.T) { diff --git a/pkg/api/user_token.go b/pkg/api/user_token.go index dc13fa1ce77..8a55c1e3385 100644 --- a/pkg/api/user_token.go +++ b/pkg/api/user_token.go @@ -6,6 +6,8 @@ import ( "net/http" "time" + "github.com/ua-parser/uap-go/uaparser" + "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/services/auth" @@ -13,7 +15,6 @@ import ( "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/util" "github.com/grafana/grafana/pkg/web" - "github.com/ua-parser/uap-go/uaparser" ) // swagger:route GET /user/auth-tokens signed_in_user getUserAuthTokens