Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore(linter): goimports check bytebase packages after 3rd-party packages (#2414)
Yilong Li1dfef8b62f1c
diff --git a/.golangci.yaml b/.golangci.yamlindex adfc06cb35..1fb87971e6 100644--- a/.golangci.yaml+++ b/.golangci.yaml@@ -34,6 +34,10 @@ run:- mysqllinters-settings:+ goimports:+ # Put imports beginning with prefix after 3rd-party packages.+ # It's a comma-separated list of prefixes.+ local-prefixes: github.com/bytebase/bytebaserevive:# Default to run all linters so that new rules in the future could automatically be added to the static check.enable-all-rules: truediff --git a/.vscode/settings.json b/.vscode/settings.jsonindex bed7758348..6de146bbf3 100644--- a/.vscode/settings.json+++ b/.vscode/settings.json@@ -42,5 +42,8 @@"i18n-ally.parserOptions": {},"go.lintOnSave": "workspace","go.lintTool": "golangci-lint",- "go.buildTags": "mysql"+ "go.buildTags": "mysql",+ "gopls": {+ "formatting.local": "github.com/bytebase/bytebase"+ }}diff --git a/api/policy.go b/api/policy.goindex 5029a39c69..196be60ef3 100644--- a/api/policy.go+++ b/api/policy.go@@ -3,8 +3,9 @@ package apiimport ("encoding/json"- "github.com/bytebase/bytebase/plugin/advisor""github.com/pkg/errors"++ "github.com/bytebase/bytebase/plugin/advisor")// PolicyType is the type or name of a policy.diff --git a/api/project_test.go b/api/project_test.goindex 93ce1917ea..2a3a92e5e2 100644--- a/api/project_test.go+++ b/api/project_test.go@@ -3,8 +3,9 @@ package apiimport ("testing"- "github.com/bytebase/bytebase/common""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/common")func TestGetTemplateTokens(t *testing.T) {diff --git a/bin/bb/cmd/dump_test.go b/bin/bb/cmd/dump_test.goindex 67f46d4250..f10e52c333 100644--- a/bin/bb/cmd/dump_test.go+++ b/bin/bb/cmd/dump_test.go@@ -10,8 +10,9 @@ import (// Embedded expected output._ "embed"- "github.com/bytebase/bytebase/resources/mysql""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/resources/mysql")var (diff --git a/bin/bb/cmd/migrate.go b/bin/bb/cmd/migrate.goindex 3aa01309fc..51bfdd4d2b 100644--- a/bin/bb/cmd/migrate.go+++ b/bin/bb/cmd/migrate.go@@ -8,11 +8,12 @@ import ("os/user""strings"- "github.com/bytebase/bytebase/common"- "github.com/bytebase/bytebase/plugin/db""github.com/pkg/errors""github.com/spf13/cobra""github.com/xo/dburl"++ "github.com/bytebase/bytebase/common"+ "github.com/bytebase/bytebase/plugin/db")func newMigrateCmd() *cobra.Command {diff --git a/bin/bb/cmd/migrate_test.go b/bin/bb/cmd/migrate_test.goindex 2714568dd8..6d949335ca 100644--- a/bin/bb/cmd/migrate_test.go+++ b/bin/bb/cmd/migrate_test.go@@ -7,9 +7,10 @@ import ("fmt""testing"- "github.com/bytebase/bytebase/resources/mysql""github.com/stretchr/testify/require"+ "github.com/bytebase/bytebase/resources/mysql"+// embed expected output._ "embed")diff --git a/bin/bb/cmd/root.go b/bin/bb/cmd/root.goindex 53147e68bb..903c1d6e47 100644--- a/bin/bb/cmd/root.go+++ b/bin/bb/cmd/root.go@@ -2,8 +2,9 @@package cmdimport (- "github.com/bytebase/bytebase/common/log""github.com/spf13/cobra"++ "github.com/bytebase/bytebase/common/log")// NewRootCmd creates the root command.diff --git a/bin/bb/cmd/root_test.go b/bin/bb/cmd/root_test.goindex be2e8350d1..ba59b2c6a3 100644--- a/bin/bb/cmd/root_test.go+++ b/bin/bb/cmd/root_test.go@@ -7,11 +7,12 @@ import ("strings""testing"- "github.com/bytebase/bytebase/common/log"_ "github.com/go-sql-driver/mysql""github.com/google/go-cmp/cmp""github.com/spf13/cobra""go.uber.org/zap"++ "github.com/bytebase/bytebase/common/log")const (diff --git a/bin/bb/cmd/utils.go b/bin/bb/cmd/utils.goindex 56e425151a..9c66d25eec 100644--- a/bin/bb/cmd/utils.go+++ b/bin/bb/cmd/utils.go@@ -4,16 +4,18 @@ import ("context""os"+ "github.com/pkg/errors"+ "github.com/xo/dburl"+"github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/resources/mysqlutil""github.com/bytebase/bytebase/resources/postgres"- "github.com/pkg/errors"// install mysql driver._ "github.com/bytebase/bytebase/plugin/db/mysql"- // install pg driver.+ // register pg driver._ "github.com/bytebase/bytebase/plugin/db/pg"- "github.com/xo/dburl"+ // install pg driver.)func getDatabase(u *dburl.URL) string {diff --git a/bin/server/cmd/root.go b/bin/server/cmd/root.goindex 3a97fe16a2..59944d9745 100644--- a/bin/server/cmd/root.go+++ b/bin/server/cmd/root.go@@ -11,13 +11,14 @@ import ("strings""syscall"- "github.com/bytebase/bytebase/common"- "github.com/bytebase/bytebase/common/log"- "github.com/bytebase/bytebase/server""github.com/pkg/errors""github.com/spf13/cobra""go.uber.org/zap"+ "github.com/bytebase/bytebase/common"+ "github.com/bytebase/bytebase/common/log"+ "github.com/bytebase/bytebase/server"+// Register clickhouse driver._ "github.com/bytebase/bytebase/plugin/db/clickhouse"// Register mysql driver.diff --git a/bin/sql-service/cmd/root.go b/bin/sql-service/cmd/root.goindex 01164600cb..0ca139c033 100644--- a/bin/sql-service/cmd/root.go+++ b/bin/sql-service/cmd/root.go@@ -9,11 +9,12 @@ import ("os/signal""syscall"+ "github.com/spf13/cobra"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log"server "github.com/bytebase/bytebase/sql-server"- "github.com/spf13/cobra"- "go.uber.org/zap"// Register pingcap parser driver._ "github.com/pingcap/tidb/types/parser_driver"diff --git a/enterprise/api/license.go b/enterprise/api/license.goindex 6ce87afcdb..0dbeef9e33 100644--- a/enterprise/api/license.go+++ b/enterprise/api/license.go@@ -5,8 +5,9 @@ import ("strings""time"- "github.com/bytebase/bytebase/api""github.com/pkg/errors"++ "github.com/bytebase/bytebase/api")// validPlans is a string array of valid plan types.diff --git a/enterprise/config/config.go b/enterprise/config/config.goindex a0325ad436..2b96a7b144 100644--- a/enterprise/config/config.go+++ b/enterprise/config/config.go@@ -6,10 +6,11 @@ import ("fmt""io/fs"- "github.com/bytebase/bytebase/common"- "github.com/bytebase/bytebase/common/log""github.com/pkg/errors""go.uber.org/zap"++ "github.com/bytebase/bytebase/common"+ "github.com/bytebase/bytebase/common/log")//go:embed keysdiff --git a/metric/collector/instance_count.go b/metric/collector/instance_count.goindex 1fc44bfc11..3e6590c9c9 100644--- a/metric/collector/instance_count.go+++ b/metric/collector/instance_count.go@@ -3,11 +3,12 @@ package collectorimport ("context"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common/log"metricAPI "github.com/bytebase/bytebase/metric""github.com/bytebase/bytebase/plugin/metric""github.com/bytebase/bytebase/store"- "go.uber.org/zap")var _ metric.Collector = (*instanceCountCollector)(nil)diff --git a/plugin/advisor/advisor.go b/plugin/advisor/advisor.goindex 5cb4c0babf..51618718d8 100644--- a/plugin/advisor/advisor.go+++ b/plugin/advisor/advisor.go@@ -6,10 +6,11 @@ import ("fmt""sync"- "github.com/bytebase/bytebase/plugin/advisor/catalog"- "github.com/bytebase/bytebase/plugin/advisor/db""github.com/pkg/errors""go.uber.org/zap/zapcore"++ "github.com/bytebase/bytebase/plugin/advisor/catalog"+ "github.com/bytebase/bytebase/plugin/advisor/db")// Status is the advisor result status.diff --git a/plugin/advisor/mysql/advisor_column_disallow_changing_type.go b/plugin/advisor/mysql/advisor_column_disallow_changing_type.goindex 6da0c5af0b..367297e417 100644--- a/plugin/advisor/mysql/advisor_column_disallow_changing_type.go+++ b/plugin/advisor/mysql/advisor_column_disallow_changing_type.go@@ -1,9 +1,10 @@package mysqlimport (+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_column_no_null.go b/plugin/advisor/mysql/advisor_column_no_null.goindex 9c2adc089e..16697f6466 100644--- a/plugin/advisor/mysql/advisor_column_no_null.go+++ b/plugin/advisor/mysql/advisor_column_no_null.go@@ -3,9 +3,10 @@ package mysqlimport ("fmt"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_column_required.go b/plugin/advisor/mysql/advisor_column_required.goindex 2e31eadf39..f3cb625ce3 100644--- a/plugin/advisor/mysql/advisor_column_required.go+++ b/plugin/advisor/mysql/advisor_column_required.go@@ -5,9 +5,10 @@ import ("sort""strings"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_column_required_test.go b/plugin/advisor/mysql/advisor_column_required_test.goindex fe8dbea93a..4ae776b8ac 100644--- a/plugin/advisor/mysql/advisor_column_required_test.go+++ b/plugin/advisor/mysql/advisor_column_required_test.go@@ -4,8 +4,9 @@ import ("encoding/json""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestColumnRequirement(t *testing.T) {diff --git a/plugin/advisor/mysql/advisor_database_drop_empty_db.go b/plugin/advisor/mysql/advisor_database_drop_empty_db.goindex ff01d4a919..b411593b30 100644--- a/plugin/advisor/mysql/advisor_database_drop_empty_db.go+++ b/plugin/advisor/mysql/advisor_database_drop_empty_db.go@@ -3,10 +3,11 @@ package mysqlimport ("fmt"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/catalog""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_naming_column.go b/plugin/advisor/mysql/advisor_naming_column.goindex f514a9b554..de98190bb4 100644--- a/plugin/advisor/mysql/advisor_naming_column.go+++ b/plugin/advisor/mysql/advisor_naming_column.go@@ -4,9 +4,10 @@ import ("fmt""regexp"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_naming_column_test.go b/plugin/advisor/mysql/advisor_naming_column_test.goindex 43516032b0..5510efa4b1 100644--- a/plugin/advisor/mysql/advisor_naming_column_test.go+++ b/plugin/advisor/mysql/advisor_naming_column_test.go@@ -5,8 +5,9 @@ import ("fmt""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingColumnConvention(t *testing.T) {diff --git a/plugin/advisor/mysql/advisor_naming_foreign_key_convention.go b/plugin/advisor/mysql/advisor_naming_foreign_key_convention.goindex 3eac6275e1..db531aab22 100644--- a/plugin/advisor/mysql/advisor_naming_foreign_key_convention.go+++ b/plugin/advisor/mysql/advisor_naming_foreign_key_convention.go@@ -4,9 +4,10 @@ import ("fmt""strings"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_naming_foreign_key_convention_test.go b/plugin/advisor/mysql/advisor_naming_foreign_key_convention_test.goindex 3fb2220286..6f719913be 100644--- a/plugin/advisor/mysql/advisor_naming_foreign_key_convention_test.go+++ b/plugin/advisor/mysql/advisor_naming_foreign_key_convention_test.go@@ -5,8 +5,9 @@ import ("fmt""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingFKConvention(t *testing.T) {diff --git a/plugin/advisor/mysql/advisor_naming_index_convention.go b/plugin/advisor/mysql/advisor_naming_index_convention.goindex 47eb96d1ff..7ab29f0421 100644--- a/plugin/advisor/mysql/advisor_naming_index_convention.go+++ b/plugin/advisor/mysql/advisor_naming_index_convention.go@@ -5,10 +5,11 @@ import ("regexp""strings"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/catalog""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_naming_index_convention_test.go b/plugin/advisor/mysql/advisor_naming_index_convention_test.goindex 0af5088c31..131da855f2 100644--- a/plugin/advisor/mysql/advisor_naming_index_convention_test.go+++ b/plugin/advisor/mysql/advisor_naming_index_convention_test.go@@ -6,8 +6,9 @@ import ("strings""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingIndexConvention(t *testing.T) {diff --git a/plugin/advisor/mysql/advisor_naming_table.go b/plugin/advisor/mysql/advisor_naming_table.goindex 99330d5476..2e852f0e2e 100644--- a/plugin/advisor/mysql/advisor_naming_table.go+++ b/plugin/advisor/mysql/advisor_naming_table.go@@ -4,9 +4,10 @@ import ("fmt""regexp"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_naming_table_test.go b/plugin/advisor/mysql/advisor_naming_table_test.goindex d6d81c9bd8..623875c3a6 100644--- a/plugin/advisor/mysql/advisor_naming_table_test.go+++ b/plugin/advisor/mysql/advisor_naming_table_test.go@@ -5,8 +5,9 @@ import ("fmt""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestMySQLNamingTableConvention(t *testing.T) {diff --git a/plugin/advisor/mysql/advisor_naming_unique_key_convention.go b/plugin/advisor/mysql/advisor_naming_unique_key_convention.goindex c06f9afe8b..87bcf6273c 100644--- a/plugin/advisor/mysql/advisor_naming_unique_key_convention.go+++ b/plugin/advisor/mysql/advisor_naming_unique_key_convention.go@@ -4,10 +4,11 @@ import ("fmt""strings"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/catalog""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_naming_unique_key_convention_test.go b/plugin/advisor/mysql/advisor_naming_unique_key_convention_test.goindex c01f786d99..1be026e3c9 100644--- a/plugin/advisor/mysql/advisor_naming_unique_key_convention_test.go+++ b/plugin/advisor/mysql/advisor_naming_unique_key_convention_test.go@@ -6,8 +6,9 @@ import ("strings""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingUKConvention(t *testing.T) {diff --git a/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go b/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.goindex 741721a2f1..2881ae9d8f 100644--- a/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go+++ b/plugin/advisor/mysql/advisor_stmt_no_leading_wildcard_like.go@@ -3,10 +3,11 @@ package mysqlimport ("fmt"- "github.com/bytebase/bytebase/plugin/advisor"- "github.com/bytebase/bytebase/plugin/advisor/db""github.com/pingcap/tidb/parser/ast""github.com/pingcap/tidb/parser/format"++ "github.com/bytebase/bytebase/plugin/advisor"+ "github.com/bytebase/bytebase/plugin/advisor/db")const (diff --git a/plugin/advisor/mysql/advisor_stmt_no_select_all.go b/plugin/advisor/mysql/advisor_stmt_no_select_all.goindex 4c45715a40..65f9cf00df 100644--- a/plugin/advisor/mysql/advisor_stmt_no_select_all.go+++ b/plugin/advisor/mysql/advisor_stmt_no_select_all.go@@ -3,9 +3,10 @@ package mysqlimport ("fmt"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_table_drop_naming_convention.go b/plugin/advisor/mysql/advisor_table_drop_naming_convention.goindex bcbf97ee07..e1d2187065 100644--- a/plugin/advisor/mysql/advisor_table_drop_naming_convention.go+++ b/plugin/advisor/mysql/advisor_table_drop_naming_convention.go@@ -4,9 +4,10 @@ import ("fmt""regexp"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_table_drop_naming_convention_test.go b/plugin/advisor/mysql/advisor_table_drop_naming_convention_test.goindex 438908916c..ff0ed7f676 100644--- a/plugin/advisor/mysql/advisor_table_drop_naming_convention_test.go+++ b/plugin/advisor/mysql/advisor_table_drop_naming_convention_test.go@@ -4,8 +4,9 @@ import ("encoding/json""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestMySQLTableDropNamingConvention(t *testing.T) {diff --git a/plugin/advisor/mysql/advisor_table_no_fk.go b/plugin/advisor/mysql/advisor_table_no_fk.goindex df77c3f5f8..186c719582 100644--- a/plugin/advisor/mysql/advisor_table_no_fk.go+++ b/plugin/advisor/mysql/advisor_table_no_fk.go@@ -3,9 +3,10 @@ package mysqlimport ("fmt"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")var (diff --git a/plugin/advisor/mysql/advisor_table_require_pk.go b/plugin/advisor/mysql/advisor_table_require_pk.goindex a9eea2bb00..470125ef77 100644--- a/plugin/advisor/mysql/advisor_table_require_pk.go+++ b/plugin/advisor/mysql/advisor_table_require_pk.go@@ -4,10 +4,11 @@ import ("fmt""strings"+ "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/catalog""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pingcap/tidb/parser/ast")const (diff --git a/plugin/advisor/mysql/advisor_use_innodb.go b/plugin/advisor/mysql/advisor_use_innodb.goindex 86928173ff..f58dc1efa2 100644--- a/plugin/advisor/mysql/advisor_use_innodb.go+++ b/plugin/advisor/mysql/advisor_use_innodb.go@@ -4,10 +4,11 @@ import ("fmt""strings"- "github.com/bytebase/bytebase/plugin/advisor"- "github.com/bytebase/bytebase/plugin/advisor/db""github.com/pingcap/tidb/parser/ast""github.com/pingcap/tidb/parser/format"++ "github.com/bytebase/bytebase/plugin/advisor"+ "github.com/bytebase/bytebase/plugin/advisor/db")const (diff --git a/plugin/advisor/mysql/parser.go b/plugin/advisor/mysql/parser.goindex 15c81035c0..c845fa486e 100644--- a/plugin/advisor/mysql/parser.go+++ b/plugin/advisor/mysql/parser.go@@ -3,10 +3,11 @@ package mysqlimport ("fmt"- "github.com/bytebase/bytebase/plugin/advisor"- "github.com/bytebase/bytebase/plugin/parser"tidbparser "github.com/pingcap/tidb/parser""github.com/pingcap/tidb/parser/ast"++ "github.com/bytebase/bytebase/plugin/advisor"+ "github.com/bytebase/bytebase/plugin/parser")// Wrapper for parser.New().diff --git a/plugin/advisor/pg/advisor_column_required_test.go b/plugin/advisor/pg/advisor_column_required_test.goindex 19161d005f..8f8e6fc2cd 100644--- a/plugin/advisor/pg/advisor_column_required_test.go+++ b/plugin/advisor/pg/advisor_column_required_test.go@@ -4,8 +4,9 @@ import ("encoding/json""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestColumnRequirement(t *testing.T) {diff --git a/plugin/advisor/pg/advisor_naming_column_test.go b/plugin/advisor/pg/advisor_naming_column_test.goindex 1ce944bba2..57f81444e0 100644--- a/plugin/advisor/pg/advisor_naming_column_test.go+++ b/plugin/advisor/pg/advisor_naming_column_test.go@@ -5,8 +5,9 @@ import ("fmt""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingColumnConvention(t *testing.T) {diff --git a/plugin/advisor/pg/advisor_naming_foreign_key_convention_test.go b/plugin/advisor/pg/advisor_naming_foreign_key_convention_test.goindex 52a37b93cf..a0e4004205 100644--- a/plugin/advisor/pg/advisor_naming_foreign_key_convention_test.go+++ b/plugin/advisor/pg/advisor_naming_foreign_key_convention_test.go@@ -5,8 +5,9 @@ import ("fmt""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingFKConvention(t *testing.T) {diff --git a/plugin/advisor/pg/advisor_naming_index_convention_test.go b/plugin/advisor/pg/advisor_naming_index_convention_test.goindex 3fbc1b6568..6d787d18e0 100644--- a/plugin/advisor/pg/advisor_naming_index_convention_test.go+++ b/plugin/advisor/pg/advisor_naming_index_convention_test.go@@ -6,8 +6,9 @@ import ("strings""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingIndexConvention(t *testing.T) {diff --git a/plugin/advisor/pg/advisor_naming_primary_key_convention_test.go b/plugin/advisor/pg/advisor_naming_primary_key_convention_test.goindex 4f36b6fc5e..790203ae35 100644--- a/plugin/advisor/pg/advisor_naming_primary_key_convention_test.go+++ b/plugin/advisor/pg/advisor_naming_primary_key_convention_test.go@@ -6,8 +6,9 @@ import ("strings""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingPKConvention(t *testing.T) {diff --git a/plugin/advisor/pg/advisor_naming_table_test.go b/plugin/advisor/pg/advisor_naming_table_test.goindex d624ce57ca..674f6e186d 100644--- a/plugin/advisor/pg/advisor_naming_table_test.go+++ b/plugin/advisor/pg/advisor_naming_table_test.go@@ -5,8 +5,9 @@ import ("fmt""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestPostgreSQLNamingTableConvention(t *testing.T) {diff --git a/plugin/advisor/pg/advisor_naming_unique_key_convention_test.go b/plugin/advisor/pg/advisor_naming_unique_key_convention_test.goindex 4de4073fea..020e29e79d 100644--- a/plugin/advisor/pg/advisor_naming_unique_key_convention_test.go+++ b/plugin/advisor/pg/advisor_naming_unique_key_convention_test.go@@ -6,8 +6,9 @@ import ("strings""testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor")func TestNamingUKConvention(t *testing.T) {diff --git a/plugin/advisor/pg/advisor_syntax_test.go b/plugin/advisor/pg/advisor_syntax_test.goindex 73be0d2f89..582d1bf690 100644--- a/plugin/advisor/pg/advisor_syntax_test.go+++ b/plugin/advisor/pg/advisor_syntax_test.go@@ -3,10 +3,11 @@ package pgimport ("testing"- "github.com/bytebase/bytebase/plugin/advisor""github.com/stretchr/testify/assert""github.com/stretchr/testify/require"+ "github.com/bytebase/bytebase/plugin/advisor"+_ "github.com/bytebase/bytebase/plugin/parser/engine/pg")diff --git a/plugin/advisor/sql_review.go b/plugin/advisor/sql_review.goindex a51415ba91..5090663d21 100644--- a/plugin/advisor/sql_review.go+++ b/plugin/advisor/sql_review.go@@ -6,9 +6,10 @@ import ("log""regexp"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/plugin/advisor/catalog""github.com/bytebase/bytebase/plugin/advisor/db"- "github.com/pkg/errors")// How to add a SQL review rule:diff --git a/plugin/advisor/utils_for_tests.go b/plugin/advisor/utils_for_tests.goindex acb53ac117..c49c10a395 100644--- a/plugin/advisor/utils_for_tests.go+++ b/plugin/advisor/utils_for_tests.go@@ -5,10 +5,11 @@ import ("testing""time"- "github.com/bytebase/bytebase/plugin/advisor/catalog"- "github.com/bytebase/bytebase/plugin/advisor/db""github.com/stretchr/testify/assert""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/plugin/advisor/catalog"+ "github.com/bytebase/bytebase/plugin/advisor/db")const (diff --git a/plugin/db/clickhouse/clickhouse.go b/plugin/db/clickhouse/clickhouse.goindex d5110fdc7e..833fc16146 100644--- a/plugin/db/clickhouse/clickhouse.go+++ b/plugin/db/clickhouse/clickhouse.go@@ -9,12 +9,13 @@ import ("time"clickhouse "github.com/ClickHouse/clickhouse-go/v2"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "github.com/pkg/errors"- "go.uber.org/zap")var (diff --git a/plugin/db/clickhouse/dump.go b/plugin/db/clickhouse/dump.goindex 4b3544dd1e..d3c7459615 100644--- a/plugin/db/clickhouse/dump.go+++ b/plugin/db/clickhouse/dump.go@@ -7,9 +7,10 @@ import ("io""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/plugin/db/util"- "github.com/pkg/errors")// Dump and restore.diff --git a/plugin/db/clickhouse/migrate.go b/plugin/db/clickhouse/migrate.goindex d0d7419e8a..8edaff985d 100644--- a/plugin/db/clickhouse/migrate.go+++ b/plugin/db/clickhouse/migrate.go@@ -9,11 +9,12 @@ import (// embed will embeds the migration schema._ "embed"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "go.uber.org/zap")var (diff --git a/plugin/db/driver.go b/plugin/db/driver.goindex e8a22af367..1fd890a19d 100644--- a/plugin/db/driver.go+++ b/plugin/db/driver.go@@ -10,8 +10,9 @@ import ("strings""sync"- "github.com/bytebase/bytebase/plugin/vcs""github.com/pkg/errors"++ "github.com/bytebase/bytebase/plugin/vcs")// Type is the type of a database.diff --git a/plugin/db/mysql/dump.go b/plugin/db/mysql/dump.goindex eed635d9b4..ebcbd89e57 100644--- a/plugin/db/mysql/dump.go+++ b/plugin/db/mysql/dump.go@@ -14,12 +14,13 @@ import ("go.uber.org/zap"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db/util""github.com/bytebase/bytebase/resources/mysqlutil"- "github.com/pkg/errors")// Dump and restore.diff --git a/plugin/db/mysql/migrate.go b/plugin/db/mysql/migrate.goindex 37dc08291c..b03aca95c5 100644--- a/plugin/db/mysql/migrate.go+++ b/plugin/db/mysql/migrate.go@@ -8,11 +8,12 @@ import (// embed will embeds the migration schema._ "embed"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "go.uber.org/zap")var (diff --git a/plugin/db/mysql/mysql.go b/plugin/db/mysql/mysql.goindex 03bae06075..08628e05d0 100644--- a/plugin/db/mysql/mysql.go+++ b/plugin/db/mysql/mysql.go@@ -7,13 +7,14 @@ import ("fmt""strings"+ "github.com/go-sql-driver/mysql"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "github.com/go-sql-driver/mysql"- "github.com/pkg/errors"- "go.uber.org/zap")var (diff --git a/plugin/db/mysql/restore.go b/plugin/db/mysql/restore.goindex 370bff3150..db8cabc775 100644--- a/plugin/db/mysql/restore.go+++ b/plugin/db/mysql/restore.go@@ -28,13 +28,14 @@ import ("go.uber.org/zap""go.uber.org/zap/zapcore"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db/util"bbs3 "github.com/bytebase/bytebase/plugin/storage/s3""github.com/bytebase/bytebase/resources/mysqlutil"- "github.com/pkg/errors""github.com/blang/semver/v4")diff --git a/plugin/db/mysql/restore_test.go b/plugin/db/mysql/restore_test.goindex 031ab530b2..a51d69b586 100644--- a/plugin/db/mysql/restore_test.go+++ b/plugin/db/mysql/restore_test.go@@ -6,9 +6,10 @@ import ("testing""time"+ "github.com/stretchr/testify/require"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/plugin/db/util"- "github.com/stretchr/testify/require")func TestGetSafeName(t *testing.T) {diff --git a/plugin/db/pg/dump.go b/plugin/db/pg/dump.goindex 607b514325..ac6bfe86fa 100644--- a/plugin/db/pg/dump.go+++ b/plugin/db/pg/dump.go@@ -10,9 +10,10 @@ import ("path/filepath""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/parser"- "github.com/pkg/errors")// Dump dumps the database.diff --git a/plugin/db/pg/migrate.go b/plugin/db/pg/migrate.goindex 6becb302d1..c9a67c2268 100644--- a/plugin/db/pg/migrate.go+++ b/plugin/db/pg/migrate.go@@ -8,11 +8,12 @@ import (// embed will embeds the migration schema._ "embed"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "github.com/pkg/errors"- "go.uber.org/zap")var (diff --git a/plugin/db/pg/sync.go b/plugin/db/pg/sync.goindex d8dbe4d185..912dcbf7ad 100644--- a/plugin/db/pg/sync.go+++ b/plugin/db/pg/sync.go@@ -8,10 +8,11 @@ import ("strings""time"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "github.com/pkg/errors")var (diff --git a/plugin/db/snowflake/dump.go b/plugin/db/snowflake/dump.goindex 4dcc9a496b..e0d6b53f67 100644--- a/plugin/db/snowflake/dump.go+++ b/plugin/db/snowflake/dump.go@@ -7,8 +7,9 @@ import ("io""strings"- "github.com/bytebase/bytebase/plugin/db/util""github.com/pkg/errors"++ "github.com/bytebase/bytebase/plugin/db/util")// Dump and restore.diff --git a/plugin/db/snowflake/migrate.go b/plugin/db/snowflake/migrate.goindex 4b91719316..28dc1993a5 100644--- a/plugin/db/snowflake/migrate.go+++ b/plugin/db/snowflake/migrate.go@@ -8,11 +8,12 @@ import (// embed will embeds the migration schema._ "embed"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "go.uber.org/zap")var (diff --git a/plugin/db/snowflake/snowflake.go b/plugin/db/snowflake/snowflake.goindex bb4de677d5..a2d1f28768 100644--- a/plugin/db/snowflake/snowflake.go+++ b/plugin/db/snowflake/snowflake.go@@ -7,11 +7,12 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "github.com/pkg/errors"snow "github.com/snowflakedb/gosnowflake""go.uber.org/zap"diff --git a/plugin/db/sqlite/dump.go b/plugin/db/sqlite/dump.goindex 7fe5b9e258..895f84ecbe 100644--- a/plugin/db/sqlite/dump.go+++ b/plugin/db/sqlite/dump.go@@ -7,8 +7,9 @@ import ("io""strings"- "github.com/bytebase/bytebase/plugin/db/util""github.com/pkg/errors"++ "github.com/bytebase/bytebase/plugin/db/util")// Dump dumps the database.diff --git a/plugin/db/sqlite/migrate.go b/plugin/db/sqlite/migrate.goindex a6b33e641f..f3fc66b7d3 100644--- a/plugin/db/sqlite/migrate.go+++ b/plugin/db/sqlite/migrate.go@@ -8,12 +8,13 @@ import (// embed will embeds the migration schema._ "embed"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "github.com/pkg/errors"- "go.uber.org/zap")var (diff --git a/plugin/db/sqlite/sync.go b/plugin/db/sqlite/sync.goindex a0ae46fda2..8d4cc31bba 100644--- a/plugin/db/sqlite/sync.go+++ b/plugin/db/sqlite/sync.go@@ -6,10 +6,11 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/util"- "github.com/pkg/errors")var (diff --git a/plugin/parser/engine/pg/convert.go b/plugin/parser/engine/pg/convert.goindex 3e0db0d183..3e7ff495b1 100644--- a/plugin/parser/engine/pg/convert.go+++ b/plugin/parser/engine/pg/convert.go@@ -1,10 +1,11 @@package pgimport (- "github.com/bytebase/bytebase/plugin/parser"- "github.com/bytebase/bytebase/plugin/parser/ast"pgquery "github.com/pganalyze/pg_query_go/v2""github.com/pkg/errors"++ "github.com/bytebase/bytebase/plugin/parser"+ "github.com/bytebase/bytebase/plugin/parser/ast")// convert converts the pg_query.Node to ast.Node.diff --git a/plugin/parser/engine/pg/convert_test.go b/plugin/parser/engine/pg/convert_test.goindex e6035b8cdc..b6e84ae762 100644--- a/plugin/parser/engine/pg/convert_test.go+++ b/plugin/parser/engine/pg/convert_test.go@@ -3,9 +3,10 @@ package pgimport ("testing"+ "github.com/stretchr/testify/require"+"github.com/bytebase/bytebase/plugin/parser""github.com/bytebase/bytebase/plugin/parser/ast"- "github.com/stretchr/testify/require")type testData struct {diff --git a/plugin/parser/engine/pg/parser.go b/plugin/parser/engine/pg/parser.goindex 68a44d0cc6..bf9de8b0f3 100644--- a/plugin/parser/engine/pg/parser.go+++ b/plugin/parser/engine/pg/parser.go@@ -2,10 +2,11 @@package pgimport (- "github.com/bytebase/bytebase/plugin/parser"- "github.com/bytebase/bytebase/plugin/parser/ast"pgquery "github.com/pganalyze/pg_query_go/v2""github.com/pkg/errors"++ "github.com/bytebase/bytebase/plugin/parser"+ "github.com/bytebase/bytebase/plugin/parser/ast")var (diff --git a/plugin/parser/set_line_for_create_table_test.go b/plugin/parser/set_line_for_create_table_test.goindex 1cb4b33d97..78ad6a6f99 100644--- a/plugin/parser/set_line_for_create_table_test.go+++ b/plugin/parser/set_line_for_create_table_test.go@@ -3,12 +3,13 @@ package parser_testimport ("testing"- "github.com/bytebase/bytebase/plugin/parser"- "github.com/bytebase/bytebase/plugin/parser/ast"tidbparser "github.com/pingcap/tidb/parser"tidbast "github.com/pingcap/tidb/parser/ast""github.com/stretchr/testify/require"+ "github.com/bytebase/bytebase/plugin/parser"+ "github.com/bytebase/bytebase/plugin/parser/ast"+// Register postgres parser driver._ "github.com/bytebase/bytebase/plugin/parser/engine/pg"// Register pingcap parser driver.diff --git a/plugin/parser/tokenizer.go b/plugin/parser/tokenizer.goindex c077b6da23..ebbd6511a6 100644--- a/plugin/parser/tokenizer.go+++ b/plugin/parser/tokenizer.go@@ -7,9 +7,10 @@ import ("strings""unicode"- "github.com/bytebase/bytebase/plugin/parser/ast"tidbast "github.com/pingcap/tidb/parser/ast""github.com/pkg/errors"++ "github.com/bytebase/bytebase/plugin/parser/ast")const (diff --git a/plugin/parser/utils.go b/plugin/parser/utils.goindex ff9c21a49b..a736f471ce 100644--- a/plugin/parser/utils.go+++ b/plugin/parser/utils.go@@ -3,9 +3,10 @@ package parserimport ("io"- "github.com/bytebase/bytebase/plugin/parser/ast"tidbast "github.com/pingcap/tidb/parser/ast""github.com/pkg/errors"++ "github.com/bytebase/bytebase/plugin/parser/ast")// SingleSQL is a separate SQL split from multi-SQL.diff --git a/plugin/storage/s3/s3_test.go b/plugin/storage/s3/s3_test.goindex b9a88f1529..0947dc8850 100644--- a/plugin/storage/s3/s3_test.go+++ b/plugin/storage/s3/s3_test.go@@ -7,9 +7,10 @@ import ("testing""github.com/aws/aws-sdk-go-v2/aws"- "github.com/bytebase/bytebase/common/log""github.com/stretchr/testify/require""go.uber.org/zap"++ "github.com/bytebase/bytebase/common/log")const (diff --git a/resources/mysql/mysql.go b/resources/mysql/mysql.goindex 60f5b053e4..4d3ee3270a 100644--- a/resources/mysql/mysql.go+++ b/resources/mysql/mysql.go@@ -16,9 +16,10 @@ import ("testing""time"- "github.com/bytebase/bytebase/resources/utils""github.com/pkg/errors"+ "github.com/bytebase/bytebase/resources/utils"+// install mysql driver._ "github.com/go-sql-driver/mysql")diff --git a/resources/mysqlutil/mysqlutil.go b/resources/mysqlutil/mysqlutil.goindex 3b0bf483ba..d7bb0a1c96 100644--- a/resources/mysqlutil/mysqlutil.go+++ b/resources/mysqlutil/mysqlutil.go@@ -11,8 +11,9 @@ import ("runtime""strings"- "github.com/bytebase/bytebase/resources/utils""github.com/pkg/errors"++ "github.com/bytebase/bytebase/resources/utils")type binaryName stringdiff --git a/resources/postgres/postgres.go b/resources/postgres/postgres.goindex b23fe32daa..9a2d8c184e 100644--- a/resources/postgres/postgres.go+++ b/resources/postgres/postgres.go@@ -15,9 +15,10 @@ import ("syscall""testing"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/resources/utils"- "github.com/pkg/errors")// Instance is a postgres instance installed by bytebasediff --git a/server/acl.go b/server/acl.goindex 5757f056e6..152cee0b11 100644--- a/server/acl.go+++ b/server/acl.go@@ -10,9 +10,10 @@ import ("github.com/casbin/casbin/v2""github.com/pkg/errors"+ "github.com/labstack/echo/v4"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/labstack/echo/v4")const (diff --git a/server/actuator.go b/server/actuator.goindex 19ba960291..e81a15e424 100644--- a/server/actuator.go+++ b/server/actuator.go@@ -5,8 +5,9 @@ import ("strconv""strings"- "github.com/bytebase/bytebase/api""github.com/labstack/echo/v4"++ "github.com/bytebase/bytebase/api")// demoDataPath is the path prefix for demo data.diff --git a/server/anomaly_scanner.go b/server/anomaly_scanner.goindex f47d7de9f7..0bcedd6f38 100644--- a/server/anomaly_scanner.go+++ b/server/anomaly_scanner.go@@ -8,12 +8,13 @@ import ("sync""time"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors"- "go.uber.org/zap")const (diff --git a/server/backup_runner.go b/server/backup_runner.goindex e14e5650be..97ecd30e23 100644--- a/server/backup_runner.go+++ b/server/backup_runner.go@@ -11,13 +11,14 @@ import ("sync""time"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/mysql"- "github.com/pkg/errors"- "go.uber.org/zap")// NewBackupRunner creates a new backup runner.diff --git a/server/cache.go b/server/cache.goindex 91a9da1ee1..cbdb4437fa 100644--- a/server/cache.go+++ b/server/cache.go@@ -6,8 +6,9 @@ import ("encoding/gob""github.com/VictoriaMetrics/fastcache"- "github.com/bytebase/bytebase/api""github.com/pkg/errors"++ "github.com/bytebase/bytebase/api")var (diff --git a/server/database_test.go b/server/database_test.goindex e58dc8d9ea..f714dbdb7a 100644--- a/server/database_test.go+++ b/server/database_test.go@@ -3,8 +3,9 @@ package serverimport ("testing"- "github.com/bytebase/bytebase/api""github.com/stretchr/testify/assert"++ "github.com/bytebase/bytebase/api")func TestValidateDatabaseLabelList(t *testing.T) {diff --git a/server/debug.go b/server/debug.goindex b7015d41e5..2de732c384 100644--- a/server/debug.go+++ b/server/debug.go@@ -3,11 +3,12 @@ package serverimport ("net/http"- "github.com/bytebase/bytebase/api"- "github.com/bytebase/bytebase/common/log""github.com/google/jsonapi""github.com/labstack/echo/v4""go.uber.org/zap"++ "github.com/bytebase/bytebase/api"+ "github.com/bytebase/bytebase/common/log")func (s *Server) registerDebugRoutes(g *echo.Group) {diff --git a/server/deploy_test.go b/server/deploy_test.goindex 4a7439edf0..ea201ed78a 100644--- a/server/deploy_test.go+++ b/server/deploy_test.go@@ -3,8 +3,9 @@ package serverimport ("testing"- "github.com/bytebase/bytebase/api""github.com/stretchr/testify/assert"++ "github.com/bytebase/bytebase/api")func TestGetDatabaseMatrixFromDeploymentSchedule(t *testing.T) {diff --git a/server/issue_test.go b/server/issue_test.goindex 2cca105136..408be9126f 100644--- a/server/issue_test.go+++ b/server/issue_test.go@@ -3,10 +3,11 @@ package serverimport ("testing"- "github.com/bytebase/bytebase/api"- "github.com/bytebase/bytebase/plugin/db""github.com/stretchr/testify/assert""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/api"+ "github.com/bytebase/bytebase/plugin/db")func TestGetPeerTenantDatabase(t *testing.T) {diff --git a/server/metric_reporter.go b/server/metric_reporter.goindex 75f0e2572b..6629251ad7 100644--- a/server/metric_reporter.go+++ b/server/metric_reporter.go@@ -6,13 +6,14 @@ import ("sync""time"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common/log"enterpriseAPI "github.com/bytebase/bytebase/enterprise/api""github.com/bytebase/bytebase/plugin/metric""github.com/bytebase/bytebase/plugin/metric/segment""github.com/bytebase/bytebase/store"- "github.com/pkg/errors""go.uber.org/zap")diff --git a/server/openapi.go b/server/openapi.goindex 32072f3257..741b47c5b9 100644--- a/server/openapi.go+++ b/server/openapi.go@@ -7,13 +7,14 @@ import ("io""net/http"+ "github.com/labstack/echo/v4"+"github.com/bytebase/bytebase/api"metricAPI "github.com/bytebase/bytebase/metric""github.com/bytebase/bytebase/plugin/advisor/catalog"advisorDB "github.com/bytebase/bytebase/plugin/advisor/db""github.com/bytebase/bytebase/plugin/metric""github.com/bytebase/bytebase/store"- "github.com/labstack/echo/v4")var (diff --git a/server/openapi_metric.go b/server/openapi_metric.goindex 90a98243eb..1e01c04605 100644--- a/server/openapi_metric.go+++ b/server/openapi_metric.go@@ -4,9 +4,10 @@ import ("strconv""time"+ "github.com/labstack/echo/v4"+metricAPI "github.com/bytebase/bytebase/metric""github.com/bytebase/bytebase/plugin/metric"- "github.com/labstack/echo/v4")func openAPIMetricMiddleware(s *Server, next echo.HandlerFunc) echo.HandlerFunc {diff --git a/server/pipeline.go b/server/pipeline.goindex 1819e4efec..e89eb49cc8 100644--- a/server/pipeline.go+++ b/server/pipeline.go@@ -3,8 +3,9 @@ package serverimport ("context"- "github.com/bytebase/bytebase/api""github.com/pkg/errors"++ "github.com/bytebase/bytebase/api")// ScheduleActiveStage tries to schedule the tasks in the active stage.diff --git a/server/recover.go b/server/recover.goindex f08a34deee..ec4539babe 100644--- a/server/recover.go+++ b/server/recover.go@@ -1,10 +1,11 @@package serverimport (- "github.com/bytebase/bytebase/common/log""github.com/labstack/echo/v4""github.com/pkg/errors""go.uber.org/zap"++ "github.com/bytebase/bytebase/common/log")func recoverMiddleware(next echo.HandlerFunc) echo.HandlerFunc {diff --git a/server/schema_syncer.go b/server/schema_syncer.goindex ade7840065..40daedb49b 100644--- a/server/schema_syncer.go+++ b/server/schema_syncer.go@@ -6,10 +6,11 @@ import ("sync""time"- "github.com/bytebase/bytebase/api"- "github.com/bytebase/bytebase/common/log""github.com/pkg/errors""go.uber.org/zap"++ "github.com/bytebase/bytebase/api"+ "github.com/bytebase/bytebase/common/log")const (diff --git a/server/server_frontend_not_embed.go b/server/server_frontend_not_embed.goindex 897b8ec286..479e454510 100644--- a/server/server_frontend_not_embed.go+++ b/server/server_frontend_not_embed.go@@ -6,8 +6,9 @@ package serverimport ("net/http"- "github.com/bytebase/bytebase/common/log""github.com/labstack/echo/v4"++ "github.com/bytebase/bytebase/common/log")func embedFrontend(e *echo.Echo) {diff --git a/server/task_check_executor_statement_type.go b/server/task_check_executor_statement_type.goindex 823328e869..9236708cdd 100644--- a/server/task_check_executor_statement_type.go+++ b/server/task_check_executor_statement_type.go@@ -5,14 +5,15 @@ import ("encoding/json""fmt"+ tidbparser "github.com/pingcap/tidb/parser"+ tidbast "github.com/pingcap/tidb/parser/ast"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/parser""github.com/bytebase/bytebase/plugin/parser/ast"- tidbparser "github.com/pingcap/tidb/parser"- tidbast "github.com/pingcap/tidb/parser/ast")// NewTaskCheckStatementTypeExecutor creates a task check DML executor.diff --git a/server/task_check_scheduler.go b/server/task_check_scheduler.goindex bef97008af..728c03020c 100644--- a/server/task_check_scheduler.go+++ b/server/task_check_scheduler.go@@ -7,12 +7,13 @@ import ("sync""time"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors"- "go.uber.org/zap")// NewTaskCheckScheduler creates a task check scheduler.diff --git a/server/task_executor.go b/server/task_executor.goindex 3d85484e24..088868d545 100644--- a/server/task_executor.go+++ b/server/task_executor.go@@ -10,12 +10,13 @@ import ("go.uber.org/zap"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"vcsPlugin "github.com/bytebase/bytebase/plugin/vcs"- "github.com/pkg/errors")// TaskExecutor is the task executor.diff --git a/server/task_executor_data_update.go b/server/task_executor_data_update.goindex 719ad33042..4e4e4995db 100644--- a/server/task_executor_data_update.go+++ b/server/task_executor_data_update.go@@ -5,9 +5,10 @@ import ("encoding/json""sync/atomic"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors")// NewDataUpdateTaskExecutor creates a data update (DML) task executor.diff --git a/server/task_executor_database_backup.go b/server/task_executor_database_backup.goindex 23e3e831e8..c6ae7ca911 100644--- a/server/task_executor_database_backup.go+++ b/server/task_executor_database_backup.go@@ -8,11 +8,12 @@ import ("path/filepath""sync/atomic"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors"- "go.uber.org/zap")// NewDatabaseBackupTaskExecutor creates a new database backup task executor.diff --git a/server/task_executor_database_create.go b/server/task_executor_database_create.goindex 1e2d84905d..02fe8e28e8 100644--- a/server/task_executor_database_create.go+++ b/server/task_executor_database_create.go@@ -8,11 +8,12 @@ import ("strings""sync/atomic"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors"- "go.uber.org/zap")// NewDatabaseCreateTaskExecutor creates a database create task executor.diff --git a/server/task_executor_database_restore.go b/server/task_executor_database_restore.goindex 260d87ed7b..075fe2a27b 100644--- a/server/task_executor_database_restore.go+++ b/server/task_executor_database_restore.go@@ -9,11 +9,12 @@ import ("strconv""sync/atomic"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors""go.uber.org/zap")diff --git a/server/task_executor_default.go b/server/task_executor_default.goindex a1c6aecf76..f2af6ef01d 100644--- a/server/task_executor_default.go+++ b/server/task_executor_default.go@@ -5,9 +5,10 @@ import ("fmt""sync/atomic"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common/log"- "go.uber.org/zap")// NewDefaultTaskExecutor creates a default task executor.diff --git a/server/task_executor_pitr_cutover.go b/server/task_executor_pitr_cutover.goindex d1f0779063..471c2bca82 100644--- a/server/task_executor_pitr_cutover.go+++ b/server/task_executor_pitr_cutover.go@@ -9,14 +9,15 @@ import ("sync/atomic""time"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/plugin/db/mysql""github.com/bytebase/bytebase/plugin/db/util"- "github.com/pkg/errors"- "go.uber.org/zap")// NewPITRCutoverTaskExecutor creates a PITR cutover task executor.diff --git a/server/task_executor_pitr_restore.go b/server/task_executor_pitr_restore.goindex 8280b5b663..b9f20af552 100644--- a/server/task_executor_pitr_restore.go+++ b/server/task_executor_pitr_restore.go@@ -9,6 +9,9 @@ import ("sync/atomic""time"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log"@@ -17,8 +20,6 @@ import ("github.com/bytebase/bytebase/plugin/db/pg""github.com/bytebase/bytebase/plugin/db/util""github.com/bytebase/bytebase/store"- "github.com/pkg/errors"- "go.uber.org/zap")// NewPITRRestoreTaskExecutor creates a PITR restore task executor.diff --git a/server/task_executor_schema_update.go b/server/task_executor_schema_update.goindex 2aa21e7eab..c18694f4b7 100644--- a/server/task_executor_schema_update.go+++ b/server/task_executor_schema_update.go@@ -5,8 +5,9 @@ import ("encoding/json""sync/atomic"- "github.com/bytebase/bytebase/api""github.com/pkg/errors"++ "github.com/bytebase/bytebase/api")// NewSchemaUpdateTaskExecutor creates a schema update (DDL) task executor.diff --git a/server/task_scheduler.go b/server/task_scheduler.goindex 9b3ed58905..d16ce5bed5 100644--- a/server/task_scheduler.go+++ b/server/task_scheduler.go@@ -8,11 +8,12 @@ import ("sync""time"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors""go.uber.org/zap")diff --git a/server/task_test.go b/server/task_test.goindex faac806717..3eca43ff1a 100644--- a/server/task_test.go+++ b/server/task_test.go@@ -3,8 +3,9 @@ package serverimport ("testing"- "github.com/bytebase/bytebase/api""github.com/stretchr/testify/assert"++ "github.com/bytebase/bytebase/api")func TestAreAllTasksDone(t *testing.T) {diff --git a/sql-server/advise.go b/sql-server/advise.goindex 31650742f1..7d39a8c614 100644--- a/sql-server/advise.go+++ b/sql-server/advise.go@@ -9,12 +9,13 @@ import (metricAPI "github.com/bytebase/bytebase/metric"+ "github.com/labstack/echo/v4"+ "gopkg.in/yaml.v3"+"github.com/bytebase/bytebase/plugin/advisor""github.com/bytebase/bytebase/plugin/advisor/catalog"advisorDB "github.com/bytebase/bytebase/plugin/advisor/db""github.com/bytebase/bytebase/plugin/metric"- "github.com/labstack/echo/v4"- "gopkg.in/yaml.v3")var (diff --git a/sql-server/metric.go b/sql-server/metric.goindex b53d30ff64..b39743044c 100644--- a/sql-server/metric.go+++ b/sql-server/metric.go@@ -4,11 +4,12 @@ import ("strconv""time"+ "github.com/labstack/echo/v4"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common/log"metricAPI "github.com/bytebase/bytebase/metric""github.com/bytebase/bytebase/plugin/metric"- "github.com/labstack/echo/v4"- "go.uber.org/zap")type metricReporter struct {diff --git a/sql-server/server.go b/sql-server/server.goindex d68f63972d..5d081a8b69 100644--- a/sql-server/server.go+++ b/sql-server/server.go@@ -7,16 +7,18 @@ import ("net/http""time"+ echoSwagger "github.com/swaggo/echo-swagger"+_ "github.com/bytebase/bytebase/docs/sqlservice" // initial the swagger doc"github.com/bytebase/bytebase/plugin/metric/segment"- echoSwagger "github.com/swaggo/echo-swagger"- "github.com/bytebase/bytebase/common"- "github.com/bytebase/bytebase/common/log""github.com/labstack/echo-contrib/pprof""github.com/labstack/echo-contrib/prometheus""github.com/labstack/echo/v4""github.com/labstack/echo/v4/middleware"++ "github.com/bytebase/bytebase/common"+ "github.com/bytebase/bytebase/common/log")// Server is the Bytebase server.diff --git a/store/activity.go b/store/activity.goindex df7ccda598..d8e8106099 100644--- a/store/activity.go+++ b/store/activity.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// activityRaw is the store model for an Activity.diff --git a/store/anomaly.go b/store/anomaly.goindex 0f8070a02f..e79bfc7600 100644--- a/store/anomaly.go+++ b/store/anomaly.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// anomalyRaw is the store model for an Anomaly.diff --git a/store/backup.go b/store/backup.goindex 909d3a748d..71ce5fc092 100644--- a/store/backup.go+++ b/store/backup.go@@ -7,9 +7,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// backupRaw is the store model for an Backup.diff --git a/store/bookmark.go b/store/bookmark.goindex 9c7d0bc365..fe86743d92 100644--- a/store/bookmark.go+++ b/store/bookmark.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// bookmarkRaw is the store model for an Bookmark.diff --git a/store/catalog.go b/store/catalog.goindex b7279fc0bd..f206dbcc1f 100644--- a/store/catalog.go+++ b/store/catalog.go@@ -5,11 +5,12 @@ import ("sort""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/plugin/advisor/catalog"advisorDB "github.com/bytebase/bytebase/plugin/advisor/db""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors")var (diff --git a/store/catalog_test.go b/store/catalog_test.goindex 094bbe58f0..7dd0df7b6b 100644--- a/store/catalog_test.go+++ b/store/catalog_test.go@@ -3,9 +3,10 @@ package storeimport ("testing"+ "github.com/stretchr/testify/assert"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/plugin/advisor/catalog"- "github.com/stretchr/testify/assert")func TestConvertIndexList(t *testing.T) {diff --git a/store/column_test.go b/store/column_test.goindex 2045bf7d17..f77580d8d8 100644--- a/store/column_test.go+++ b/store/column_test.go@@ -3,9 +3,10 @@ package storeimport ("testing"+ "github.com/stretchr/testify/require"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/plugin/db"- "github.com/stretchr/testify/require")func TestGenerateColumnActions(t *testing.T) {diff --git a/store/data_source.go b/store/data_source.goindex d58e84cd3b..3a827f1d1b 100644--- a/store/data_source.go+++ b/store/data_source.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// dataSourceRaw is the store model for an DataSource.diff --git a/store/database.go b/store/database.goindex e44ce26237..c172f091c7 100644--- a/store/database.go+++ b/store/database.go@@ -8,10 +8,11 @@ import ("math/rand""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/metric"- "github.com/pkg/errors")// databaseRaw is the store model for an Database.diff --git a/store/deploy.go b/store/deploy.goindex f757f55bd1..a80d4d4b71 100644--- a/store/deploy.go+++ b/store/deploy.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// deploymentConfigRaw is the store model for an DeploymentConfig.diff --git a/store/environment.go b/store/environment.goindex f294edd030..5993da5e02 100644--- a/store/environment.go+++ b/store/environment.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// environmentRaw is the store model for an Environment.diff --git a/store/extension.go b/store/extension.goindex 21aec98071..2fb1b49e99 100644--- a/store/extension.go+++ b/store/extension.go@@ -6,10 +6,11 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors")// dbExtensionRaw is the store model for an DBExtension.diff --git a/store/extension_test.go b/store/extension_test.goindex 5bb195087c..f2b0029919 100644--- a/store/extension_test.go+++ b/store/extension_test.go@@ -3,9 +3,10 @@ package storeimport ("testing"+ "github.com/stretchr/testify/require"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/plugin/db"- "github.com/stretchr/testify/require")func TestGenerateDBExtensionActions(t *testing.T) {diff --git a/store/inbox.go b/store/inbox.goindex 09c286178d..fa28866685 100644--- a/store/inbox.go+++ b/store/inbox.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// inboxRaw is the store model for an Inbox.diff --git a/store/instance.go b/store/instance.goindex 3130234ebd..61f6497a83 100644--- a/store/instance.go+++ b/store/instance.go@@ -6,11 +6,12 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/metric""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors")// instanceRaw is the store model for an Instance.diff --git a/store/instance_user.go b/store/instance_user.goindex dd70fba0cc..1f14baaaa3 100644--- a/store/instance_user.go+++ b/store/instance_user.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// UpsertInstanceUser would update the existing user if name matches.diff --git a/store/issue.go b/store/issue.goindex 91a5a7313a..c0537329e1 100644--- a/store/issue.go+++ b/store/issue.go@@ -9,10 +9,11 @@ import ("strings""time"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/metric"- "github.com/pkg/errors")// issueRaw is the store model for an Issue.diff --git a/store/issue_subscriber.go b/store/issue_subscriber.goindex ecae706dae..4d10eef896 100644--- a/store/issue_subscriber.go+++ b/store/issue_subscriber.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// issueSubscriberRaw is the store model for an IssueSubscriber.diff --git a/store/label.go b/store/label.goindex 7558775453..03e4089fe6 100644--- a/store/label.go+++ b/store/label.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// labelKeyRaw is the store model for an LabelKey.diff --git a/store/member.go b/store/member.goindex 872accbcac..7422deba4a 100644--- a/store/member.go+++ b/store/member.go@@ -6,10 +6,11 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/metric"- "github.com/pkg/errors")// memberRaw is the store model for an Member.diff --git a/store/metadb.go b/store/metadb.goindex bff16e7f08..312ddf8238 100644--- a/store/metadb.go+++ b/store/metadb.go@@ -6,12 +6,13 @@ import ("net/url""os"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log"dbdriver "github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/resources/postgres"- "github.com/pkg/errors"- "go.uber.org/zap")// MetadataDB abstracts the underlying Postgres instance.diff --git a/store/pg_engine.go b/store/pg_engine.goindex 6adedbca89..912014a458 100644--- a/store/pg_engine.go+++ b/store/pg_engine.go@@ -13,9 +13,10 @@ import ("time""github.com/blang/semver/v4"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/common/log"dbdriver "github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors"// Register postgres driver._ "github.com/bytebase/bytebase/plugin/db/pg"diff --git a/store/pg_engine_test.go b/store/pg_engine_test.goindex 39c5d15a94..13238b98c1 100644--- a/store/pg_engine_test.go+++ b/store/pg_engine_test.go@@ -8,12 +8,13 @@ import ("testing""github.com/blang/semver/v4"+ "github.com/stretchr/testify/require"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log"dbdriver "github.com/bytebase/bytebase/plugin/db""github.com/bytebase/bytebase/resources/postgres"- "github.com/stretchr/testify/require"- "go.uber.org/zap")func TestGetMinorMigrationVersions(t *testing.T) {diff --git a/store/pipeline.go b/store/pipeline.goindex e1deef6473..45ec4388bd 100644--- a/store/pipeline.go+++ b/store/pipeline.go@@ -6,11 +6,12 @@ import ("fmt""strings"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log"- "github.com/pkg/errors"- "go.uber.org/zap")// pipelineRaw is the store model for an Pipeline.diff --git a/store/policy.go b/store/policy.goindex 5b78669ad3..4a9782f9b3 100644--- a/store/policy.go+++ b/store/policy.go@@ -6,10 +6,11 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/plugin/advisor"- "github.com/pkg/errors")// policyRaw is the store model for an Policy.diff --git a/store/principal.go b/store/principal.goindex 3c9d902ee1..bd50f19d8e 100644--- a/store/principal.go+++ b/store/principal.go@@ -6,11 +6,12 @@ import ("fmt""strings"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log"- "github.com/pkg/errors"- "go.uber.org/zap")// principalRaw is the store model for a Principal.diff --git a/store/project_member.go b/store/project_member.goindex 05fa7dad5f..87e83d1635 100644--- a/store/project_member.go+++ b/store/project_member.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// projectMemberRaw is the store model for an ProjectMember.diff --git a/store/setting.go b/store/setting.goindex cb5a274be3..a3cbea8699 100644--- a/store/setting.go+++ b/store/setting.go@@ -5,9 +5,10 @@ import ("database/sql""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// settingRaw is the store model for an Setting.diff --git a/store/sheet.go b/store/sheet.goindex 1f0df7a2f2..b260156c13 100644--- a/store/sheet.go+++ b/store/sheet.go@@ -6,10 +6,11 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/metric"- "github.com/pkg/errors")// sheetRaw is the store model for an Sheet.diff --git a/store/sheet_organizer.go b/store/sheet_organizer.goindex 0b65663e7b..d698b5675b 100644--- a/store/sheet_organizer.go+++ b/store/sheet_organizer.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// sheetOrganizerRaw is the store model for SheetOrganizer.diff --git a/store/stage.go b/store/stage.goindex 750083c9f7..af87485b8a 100644--- a/store/stage.go+++ b/store/stage.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// stageRaw is the store model for an Stage.diff --git a/store/table.go b/store/table.goindex e2d5a565c2..293d958bad 100644--- a/store/table.go+++ b/store/table.go@@ -6,11 +6,12 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors")// tableRaw is the store model for an Table.diff --git a/store/table_index_test.go b/store/table_index_test.goindex 1ae55b7308..69a44ac98b 100644--- a/store/table_index_test.go+++ b/store/table_index_test.go@@ -3,9 +3,10 @@ package storeimport ("testing"+ "github.com/stretchr/testify/require"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/plugin/db"- "github.com/stretchr/testify/require")func TestGenerateIndexActions(t *testing.T) {diff --git a/store/task.go b/store/task.goindex 5f7f934eba..19b85156ed 100644--- a/store/task.go+++ b/store/task.go@@ -8,12 +8,13 @@ import ("strings""time"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/metric"- "github.com/pkg/errors"- "go.uber.org/zap")// taskRaw is the store model for an Task.diff --git a/store/task_check_run.go b/store/task_check_run.goindex 34d1d2dbd5..801fefb63b 100644--- a/store/task_check_run.go+++ b/store/task_check_run.go@@ -6,11 +6,12 @@ import ("fmt""strings"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log"- "github.com/pkg/errors"- "go.uber.org/zap")// taskCheckRunRaw is the store model for a TaskCheckRun.diff --git a/store/task_dag.go b/store/task_dag.goindex 6c166911f4..87568fbaa1 100644--- a/store/task_dag.go+++ b/store/task_dag.go@@ -4,9 +4,10 @@ import ("context""database/sql"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")type taskDAGRaw struct {diff --git a/store/task_run.go b/store/task_run.goindex d419ba5ac0..02f9de53b9 100644--- a/store/task_run.go+++ b/store/task_run.go@@ -6,9 +6,10 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common"- "github.com/pkg/errors")// taskRunRaw is the store model for an TaskRun.diff --git a/store/vcs.go b/store/vcs.goindex a5160f25fb..1df402e8e6 100644--- a/store/vcs.go+++ b/store/vcs.go@@ -6,10 +6,11 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/plugin/vcs"- "github.com/pkg/errors")// vcsRaw is the store model for a VCS (Version Control System).diff --git a/store/view.go b/store/view.goindex 5d92d6aed3..153eb04d3d 100644--- a/store/view.go+++ b/store/view.go@@ -6,10 +6,11 @@ import ("fmt""strings"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/plugin/db"- "github.com/pkg/errors")// viewRaw is the store model for an View.diff --git a/store/view_test.go b/store/view_test.goindex 6de2d790a6..9dbb4c57aa 100644--- a/store/view_test.go+++ b/store/view_test.go@@ -3,9 +3,10 @@ package storeimport ("testing"+ "github.com/stretchr/testify/require"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/plugin/db"- "github.com/stretchr/testify/require")func TestGenerateViewActions(t *testing.T) {diff --git a/tests/external_pg_test.go b/tests/external_pg_test.goindex 8d13158a6b..40ed89ff77 100644--- a/tests/external_pg_test.go+++ b/tests/external_pg_test.go@@ -7,12 +7,13 @@ import ("path""testing"+ "github.com/pkg/errors"+ "go.uber.org/zap"+"github.com/bytebase/bytebase/common""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/resources/postgres""github.com/bytebase/bytebase/tests/fake"- "github.com/pkg/errors"- "go.uber.org/zap""github.com/stretchr/testify/require")diff --git a/tests/mysql_prepare_test.go b/tests/mysql_prepare_test.goindex 4bd31d6621..7d636c0f03 100644--- a/tests/mysql_prepare_test.go+++ b/tests/mysql_prepare_test.go@@ -6,8 +6,9 @@ package testsimport ("testing"- "github.com/bytebase/bytebase/resources/mysql""github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/resources/mysql")func TestPrepare(t *testing.T) {diff --git a/tests/mysql_test.go b/tests/mysql_test.goindex 6854b10bb0..902c003ace 100644--- a/tests/mysql_test.go+++ b/tests/mysql_test.go@@ -10,12 +10,13 @@ import ("testing""time"+ "github.com/stretchr/testify/require"+ "go.uber.org/zap/zapcore"+"github.com/bytebase/bytebase/common/log"pluginmysql "github.com/bytebase/bytebase/plugin/db/mysql"resourcemysql "github.com/bytebase/bytebase/resources/mysql""github.com/bytebase/bytebase/resources/mysqlutil"- "github.com/stretchr/testify/require"- "go.uber.org/zap/zapcore")func TestCheckEngineInnoDB(t *testing.T) {diff --git a/tests/project_test.go b/tests/project_test.goindex be3375b0ef..8766241b2f 100644--- a/tests/project_test.go+++ b/tests/project_test.go@@ -7,13 +7,14 @@ import ("strconv""testing"+ "github.com/stretchr/testify/require"+ "go.uber.org/zap/zapcore"+"github.com/bytebase/bytebase/api""github.com/bytebase/bytebase/common/log""github.com/bytebase/bytebase/plugin/db"resourcemysql "github.com/bytebase/bytebase/resources/mysql""github.com/bytebase/bytebase/tests/fake"- "github.com/stretchr/testify/require"- "go.uber.org/zap/zapcore")func TestArchiveProject(t *testing.T) {