Chore: Fix goimports grouping in pkg/services (#62420)

* fix goimports

* fix goimports order
This commit is contained in:
Serge Zaitsev 2023-01-30 09:21:27 +01:00 committed by GitHub
parent 324310abbc
commit bc2813ef06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
74 changed files with 147 additions and 109 deletions

View File

@ -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"

View File

@ -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) {

View File

@ -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 {

View File

@ -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"

View File

@ -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 {

View File

@ -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) {

View File

@ -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"
)

View File

@ -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"

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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"
)

View File

@ -5,7 +5,6 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

View File

@ -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) {

View File

@ -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 {

View File

@ -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) {

View File

@ -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 {

View File

@ -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"

View File

@ -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:

View File

@ -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 {

View File

@ -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) {

View File

@ -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 "

View File

@ -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:

View File

@ -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 {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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 {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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 {

View File

@ -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 (

View File

@ -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) {

View File

@ -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 {

View File

@ -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) {

View File

@ -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 {

View File

@ -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 (

View File

@ -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 (

View File

@ -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) {

View File

@ -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) {

View File

@ -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"

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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 {

View File

@ -9,6 +9,7 @@ import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
models "github.com/grafana/grafana/pkg/models"
)

View File

@ -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) {

View File

@ -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 {

View File

@ -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

View File

@ -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 {

View File

@ -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 (

View File

@ -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 (

View File

@ -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 {

View File

@ -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"

View File

@ -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"

View File

@ -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 {

View File

@ -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) {

View File

@ -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 {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -9,7 +9,6 @@ import (
"github.com/golang-migrate/migrate/v4/database"
"github.com/lib/pq"
"xorm.io/xorm"
)

View File

@ -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"

View File

@ -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 {

View File

@ -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

View File

@ -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) {