From ba3b60ec0978e1a22b7e11af2585fb625fc5a714 Mon Sep 17 00:00:00 2001 From: wang1309 <1028960576@qq.com> Date: Sat, 8 Apr 2023 14:07:53 +0800 Subject: [PATCH] Feat fix go import (#536) optimize go imports style --- goimports.sh | 2 +- pkg/datasource/sql/datasource/mysql/trigger.go | 1 + pkg/datasource/sql/driver_test.go | 3 ++- pkg/datasource/sql/exec/at/base_executor.go | 1 + pkg/datasource/sql/exec/at/delete_executor.go | 1 + pkg/datasource/sql/exec/at/delete_executor_test.go | 3 ++- pkg/datasource/sql/exec/at/insert_executor_test.go | 3 ++- pkg/datasource/sql/exec/at/insert_on_update_executor.go | 1 + pkg/datasource/sql/exec/at/insert_on_update_executor_test.go | 3 ++- pkg/datasource/sql/exec/at/multi_delete_executor.go | 1 + pkg/datasource/sql/exec/at/multi_delete_executor_test.go | 3 ++- pkg/datasource/sql/exec/at/multi_update_excutor.go | 1 + pkg/datasource/sql/exec/at/multi_update_excutor_test.go | 3 ++- pkg/datasource/sql/exec/at/plain_executor_test.go | 3 ++- pkg/datasource/sql/exec/at/update_executor_test.go | 3 ++- pkg/datasource/sql/hook/logger_hook.go | 3 ++- pkg/datasource/sql/mock/mock_datasource_manager.go | 5 +++-- pkg/datasource/sql/parser/parse_factory_test.go | 4 +++- pkg/datasource/sql/parser/parser_factory.go | 1 + pkg/datasource/sql/types/executor.go | 1 + pkg/datasource/sql/undo/base/undo.go | 1 + pkg/datasource/sql/undo/builder/basic_undo_log_builder.go | 1 + .../sql/undo/builder/basic_undo_log_builder_test.go | 3 ++- .../sql/undo/builder/mysql_delete_undo_log_builder.go | 1 + .../sql/undo/builder/mysql_insert_undo_log_builder.go | 1 + .../sql/undo/builder/mysql_insert_undo_log_builder_test.go | 3 ++- .../mysql_insertonduplicate_update_undo_log_builder.go | 1 + .../mysql_insertonduplicate_update_undo_log_builder_test.go | 3 ++- .../sql/undo/builder/mysql_update_undo_log_builder.go | 1 + .../sql/undo/builder/mysql_update_undo_log_builder_test.go | 3 ++- pkg/datasource/sql/undo/executor/executor.go | 1 + pkg/datasource/sql/undo/mysql/default.go | 1 + pkg/datasource/sql/undo/parser/parser_json_test.go | 3 ++- pkg/datasource/sql/undo_test.go | 3 ++- pkg/integration/dubbo/dubbo_transaction_filter.go | 1 + pkg/protocol/codec/branch_commit_req_codec_test.go | 3 ++- pkg/protocol/codec/branch_register_req_codec_test.go | 3 ++- pkg/protocol/codec/branch_register_response_codec_test.go | 3 ++- pkg/protocol/codec/branch_report_req_codec_test.go | 3 ++- pkg/protocol/codec/branch_rollback_req_codec_test.go | 3 ++- pkg/protocol/codec/branch_rollback_response_codec_test.go | 3 ++- .../codec/branch_statue_report_response_codec_test.go | 3 ++- pkg/protocol/codec/codec.go | 3 ++- pkg/protocol/codec/global_begin_request_codec_test.go | 3 ++- pkg/protocol/codec/global_commit_req_codec_test.go | 3 ++- pkg/protocol/codec/global_commit_response_codec_test.go | 3 ++- pkg/protocol/codec/global_lock_query_req_codec_test.go | 3 ++- pkg/protocol/codec/global_lock_query_resp_codec_test.go | 3 ++- pkg/protocol/codec/global_report_request_codec_test.go | 3 ++- pkg/protocol/codec/global_report_response_codec_test.go | 3 ++- pkg/protocol/codec/global_rollback_req_codec_test.go | 3 ++- pkg/protocol/codec/global_rollback_response_codec_test.go | 3 ++- pkg/protocol/codec/global_status_req_codec_test.go | 3 ++- pkg/protocol/codec/global_status_response_codec_test.go | 3 ++- pkg/protocol/codec/register_rm_request_codec_test.go | 3 ++- pkg/protocol/codec/register_rm_response_codec_test.go | 3 ++- pkg/protocol/codec/register_tm_request_codec_test.go | 3 ++- pkg/protocol/codec/register_tm_response_codec_test.go | 3 ++- pkg/rm/rm_api_test.go | 1 + pkg/rm/tcc/fence/fence_driver.go | 1 + pkg/rm/tcc/fence/fence_driver_conn.go | 1 + pkg/rm/tcc/tcc_service.go | 1 + pkg/rm/tcc/tcc_service_test.go | 3 ++- pkg/tm/global_transaction_test.go | 3 ++- 64 files changed, 108 insertions(+), 44 deletions(-) diff --git a/goimports.sh b/goimports.sh index 0ad14d51e..383253eb8 100755 --- a/goimports.sh +++ b/goimports.sh @@ -17,7 +17,7 @@ # format go imports style go install -v golang.org/x/tools/cmd/goimports -goimports -w . +goimports -local github.com/seata/seata-go -w . # format licence style go install github.com/apache/skywalking-eyes/cmd/license-eye@latest diff --git a/pkg/datasource/sql/datasource/mysql/trigger.go b/pkg/datasource/sql/datasource/mysql/trigger.go index af26097e3..2104c04ec 100644 --- a/pkg/datasource/sql/datasource/mysql/trigger.go +++ b/pkg/datasource/sql/datasource/mysql/trigger.go @@ -24,6 +24,7 @@ import ( "strings" "github.com/pkg/errors" + "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/undo/executor" ) diff --git a/pkg/datasource/sql/driver_test.go b/pkg/datasource/sql/driver_test.go index e94dfc54a..4ee9ca286 100644 --- a/pkg/datasource/sql/driver_test.go +++ b/pkg/datasource/sql/driver_test.go @@ -27,10 +27,11 @@ import ( "github.com/seata/seata-go/pkg/rm" "github.com/golang/mock/gomock" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/mock" "github.com/seata/seata-go/pkg/protocol/branch" "github.com/seata/seata-go/pkg/util/reflectx" - "github.com/stretchr/testify/assert" ) func initMockResourceManager(branchType branch.BranchType, ctrl *gomock.Controller) *mock.MockDataSourceManager { diff --git a/pkg/datasource/sql/exec/at/base_executor.go b/pkg/datasource/sql/exec/at/base_executor.go index 99dd07a44..a4681f86a 100644 --- a/pkg/datasource/sql/exec/at/base_executor.go +++ b/pkg/datasource/sql/exec/at/base_executor.go @@ -28,6 +28,7 @@ import ( "github.com/arana-db/parser/ast" "github.com/arana-db/parser/test_driver" gxsort "github.com/dubbogo/gost/sort" + "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/util" diff --git a/pkg/datasource/sql/exec/at/delete_executor.go b/pkg/datasource/sql/exec/at/delete_executor.go index b28b22289..bd3b41a67 100644 --- a/pkg/datasource/sql/exec/at/delete_executor.go +++ b/pkg/datasource/sql/exec/at/delete_executor.go @@ -24,6 +24,7 @@ import ( "github.com/arana-db/parser/ast" "github.com/arana-db/parser/format" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/parser" diff --git a/pkg/datasource/sql/exec/at/delete_executor_test.go b/pkg/datasource/sql/exec/at/delete_executor_test.go index 3a75b0aad..ebf8f1605 100644 --- a/pkg/datasource/sql/exec/at/delete_executor_test.go +++ b/pkg/datasource/sql/exec/at/delete_executor_test.go @@ -21,11 +21,12 @@ import ( "database/sql/driver" "testing" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/parser" "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/util" - "github.com/stretchr/testify/assert" ) func TestNewDeleteExecutor(t *testing.T) { diff --git a/pkg/datasource/sql/exec/at/insert_executor_test.go b/pkg/datasource/sql/exec/at/insert_executor_test.go index b7556c5a5..7419de82d 100644 --- a/pkg/datasource/sql/exec/at/insert_executor_test.go +++ b/pkg/datasource/sql/exec/at/insert_executor_test.go @@ -27,13 +27,14 @@ import ( "github.com/arana-db/parser/ast" "github.com/arana-db/parser/model" "github.com/arana-db/parser/test_driver" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/datasource/mysql" "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/parser" "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/util" - "github.com/stretchr/testify/assert" ) func TestBuildSelectSQLByInsert(t *testing.T) { diff --git a/pkg/datasource/sql/exec/at/insert_on_update_executor.go b/pkg/datasource/sql/exec/at/insert_on_update_executor.go index 65d8f64a5..5d6dc7949 100644 --- a/pkg/datasource/sql/exec/at/insert_on_update_executor.go +++ b/pkg/datasource/sql/exec/at/insert_on_update_executor.go @@ -24,6 +24,7 @@ import ( "strings" "github.com/arana-db/parser/ast" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/types" diff --git a/pkg/datasource/sql/exec/at/insert_on_update_executor_test.go b/pkg/datasource/sql/exec/at/insert_on_update_executor_test.go index fab3bf6cf..7d0c0b752 100644 --- a/pkg/datasource/sql/exec/at/insert_on_update_executor_test.go +++ b/pkg/datasource/sql/exec/at/insert_on_update_executor_test.go @@ -21,10 +21,11 @@ import ( "database/sql/driver" "testing" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/parser" "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/util" - "github.com/stretchr/testify/assert" ) func TestInsertOnUpdateBeforeImageSQL(t *testing.T) { diff --git a/pkg/datasource/sql/exec/at/multi_delete_executor.go b/pkg/datasource/sql/exec/at/multi_delete_executor.go index 53017bdf3..078a2a2dd 100644 --- a/pkg/datasource/sql/exec/at/multi_delete_executor.go +++ b/pkg/datasource/sql/exec/at/multi_delete_executor.go @@ -25,6 +25,7 @@ import ( "github.com/arana-db/parser/ast" "github.com/arana-db/parser/format" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/types" diff --git a/pkg/datasource/sql/exec/at/multi_delete_executor_test.go b/pkg/datasource/sql/exec/at/multi_delete_executor_test.go index 1989b3b94..b6d70f115 100644 --- a/pkg/datasource/sql/exec/at/multi_delete_executor_test.go +++ b/pkg/datasource/sql/exec/at/multi_delete_executor_test.go @@ -21,12 +21,13 @@ import ( "database/sql/driver" "testing" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/parser" "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/util" "github.com/seata/seata-go/pkg/util/log" - "github.com/stretchr/testify/assert" ) func Test_multiDeleteExecutor_buildBeforeImageSQL(t *testing.T) { diff --git a/pkg/datasource/sql/exec/at/multi_update_excutor.go b/pkg/datasource/sql/exec/at/multi_update_excutor.go index 0cd3656b8..262d56b93 100644 --- a/pkg/datasource/sql/exec/at/multi_update_excutor.go +++ b/pkg/datasource/sql/exec/at/multi_update_excutor.go @@ -28,6 +28,7 @@ import ( "github.com/arana-db/parser/format" "github.com/arana-db/parser/model" "github.com/pkg/errors" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/types" diff --git a/pkg/datasource/sql/exec/at/multi_update_excutor_test.go b/pkg/datasource/sql/exec/at/multi_update_excutor_test.go index 60dd7dc4f..ab5e4869e 100644 --- a/pkg/datasource/sql/exec/at/multi_update_excutor_test.go +++ b/pkg/datasource/sql/exec/at/multi_update_excutor_test.go @@ -21,6 +21,8 @@ import ( "database/sql/driver" "testing" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/datasource/mysql" "github.com/seata/seata-go/pkg/datasource/sql/exec" @@ -28,7 +30,6 @@ import ( "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/undo" "github.com/seata/seata-go/pkg/datasource/sql/util" - "github.com/stretchr/testify/assert" ) func TestBuildSelectSQLByMultiUpdate(t *testing.T) { diff --git a/pkg/datasource/sql/exec/at/plain_executor_test.go b/pkg/datasource/sql/exec/at/plain_executor_test.go index cecc8c09e..cf858a158 100644 --- a/pkg/datasource/sql/exec/at/plain_executor_test.go +++ b/pkg/datasource/sql/exec/at/plain_executor_test.go @@ -24,10 +24,11 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/exec" "github.com/seata/seata-go/pkg/datasource/sql/mock" "github.com/seata/seata-go/pkg/datasource/sql/types" - "github.com/stretchr/testify/assert" ) func TestNewPlainExecutor(t *testing.T) { diff --git a/pkg/datasource/sql/exec/at/update_executor_test.go b/pkg/datasource/sql/exec/at/update_executor_test.go index 9e01720ae..2be300e79 100644 --- a/pkg/datasource/sql/exec/at/update_executor_test.go +++ b/pkg/datasource/sql/exec/at/update_executor_test.go @@ -24,6 +24,8 @@ import ( "testing" "github.com/agiledragon/gomonkey/v2" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/datasource/mysql" "github.com/seata/seata-go/pkg/datasource/sql/exec" @@ -32,7 +34,6 @@ import ( "github.com/seata/seata-go/pkg/datasource/sql/undo" "github.com/seata/seata-go/pkg/datasource/sql/util" _ "github.com/seata/seata-go/pkg/util/log" - "github.com/stretchr/testify/assert" ) func TestBuildSelectSQLByUpdate(t *testing.T) { diff --git a/pkg/datasource/sql/hook/logger_hook.go b/pkg/datasource/sql/hook/logger_hook.go index 13a5a990c..e13d5de71 100644 --- a/pkg/datasource/sql/hook/logger_hook.go +++ b/pkg/datasource/sql/hook/logger_hook.go @@ -22,9 +22,10 @@ import ( "github.com/seata/seata-go/pkg/datasource/sql/exec" + "go.uber.org/zap" + "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/util/log" - "go.uber.org/zap" ) func NewLoggerSQLHook() exec.SQLHook { diff --git a/pkg/datasource/sql/mock/mock_datasource_manager.go b/pkg/datasource/sql/mock/mock_datasource_manager.go index cd788a245..43f54e07c 100644 --- a/pkg/datasource/sql/mock/mock_datasource_manager.go +++ b/pkg/datasource/sql/mock/mock_datasource_manager.go @@ -28,6 +28,7 @@ import ( sync "sync" gomock "github.com/golang/mock/gomock" + datasource "github.com/seata/seata-go/pkg/datasource/sql/datasource" types "github.com/seata/seata-go/pkg/datasource/sql/types" branch "github.com/seata/seata-go/pkg/protocol/branch" @@ -36,8 +37,8 @@ import ( // MockDataSourceManager is a mock of DataSourceManager interface. type MockDataSourceManager struct { - ctrl *gomock.Controller - recorder *MockDataSourceManagerMockRecorder + ctrl *gomock.Controller + recorder *MockDataSourceManagerMockRecorder branchType branch.BranchType } diff --git a/pkg/datasource/sql/parser/parse_factory_test.go b/pkg/datasource/sql/parser/parse_factory_test.go index 89001f06e..dfe06a0b2 100644 --- a/pkg/datasource/sql/parser/parse_factory_test.go +++ b/pkg/datasource/sql/parser/parse_factory_test.go @@ -23,11 +23,13 @@ import ( aparser "github.com/arana-db/parser" "github.com/arana-db/parser/format" + "github.com/seata/seata-go/pkg/util/bytes" - "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/types" + _ "github.com/arana-db/parser/test_driver" ) diff --git a/pkg/datasource/sql/parser/parser_factory.go b/pkg/datasource/sql/parser/parser_factory.go index 718e8b5bf..207b4f352 100644 --- a/pkg/datasource/sql/parser/parser_factory.go +++ b/pkg/datasource/sql/parser/parser_factory.go @@ -20,6 +20,7 @@ package parser import ( aparser "github.com/arana-db/parser" "github.com/arana-db/parser/ast" + "github.com/seata/seata-go/pkg/datasource/sql/types" ) diff --git a/pkg/datasource/sql/types/executor.go b/pkg/datasource/sql/types/executor.go index 5a3dac1ac..2c03c5b94 100644 --- a/pkg/datasource/sql/types/executor.go +++ b/pkg/datasource/sql/types/executor.go @@ -22,6 +22,7 @@ import ( "github.com/arana-db/parser/ast" "github.com/arana-db/parser/format" + seatabytes "github.com/seata/seata-go/pkg/util/bytes" ) diff --git a/pkg/datasource/sql/undo/base/undo.go b/pkg/datasource/sql/undo/base/undo.go index c686f050c..40e4eb06b 100644 --- a/pkg/datasource/sql/undo/base/undo.go +++ b/pkg/datasource/sql/undo/base/undo.go @@ -28,6 +28,7 @@ import ( "strings" "github.com/arana-db/parser/mysql" + "github.com/seata/seata-go/pkg/compressor" "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/types" diff --git a/pkg/datasource/sql/undo/builder/basic_undo_log_builder.go b/pkg/datasource/sql/undo/builder/basic_undo_log_builder.go index 61d152db2..9c49b3dc6 100644 --- a/pkg/datasource/sql/undo/builder/basic_undo_log_builder.go +++ b/pkg/datasource/sql/undo/builder/basic_undo_log_builder.go @@ -28,6 +28,7 @@ import ( "github.com/arana-db/parser/ast" "github.com/arana-db/parser/test_driver" gxsort "github.com/dubbogo/gost/sort" + "github.com/seata/seata-go/pkg/datasource/sql/types" ) diff --git a/pkg/datasource/sql/undo/builder/basic_undo_log_builder_test.go b/pkg/datasource/sql/undo/builder/basic_undo_log_builder_test.go index edc99a6cf..e5a7be136 100644 --- a/pkg/datasource/sql/undo/builder/basic_undo_log_builder_test.go +++ b/pkg/datasource/sql/undo/builder/basic_undo_log_builder_test.go @@ -20,8 +20,9 @@ package builder import ( "testing" - "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/datasource/sql/types" ) func TestBuildWhereConditionByPKs(t *testing.T) { diff --git a/pkg/datasource/sql/undo/builder/mysql_delete_undo_log_builder.go b/pkg/datasource/sql/undo/builder/mysql_delete_undo_log_builder.go index e07ae8779..e00514a5a 100644 --- a/pkg/datasource/sql/undo/builder/mysql_delete_undo_log_builder.go +++ b/pkg/datasource/sql/undo/builder/mysql_delete_undo_log_builder.go @@ -28,6 +28,7 @@ import ( "github.com/arana-db/parser/ast" "github.com/arana-db/parser/format" + "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/util/bytes" "github.com/seata/seata-go/pkg/util/log" diff --git a/pkg/datasource/sql/undo/builder/mysql_insert_undo_log_builder.go b/pkg/datasource/sql/undo/builder/mysql_insert_undo_log_builder.go index 800d74c32..cb177b8ec 100644 --- a/pkg/datasource/sql/undo/builder/mysql_insert_undo_log_builder.go +++ b/pkg/datasource/sql/undo/builder/mysql_insert_undo_log_builder.go @@ -24,6 +24,7 @@ import ( "strings" "github.com/arana-db/parser/ast" + "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/undo" "github.com/seata/seata-go/pkg/datasource/sql/undo/executor" diff --git a/pkg/datasource/sql/undo/builder/mysql_insert_undo_log_builder_test.go b/pkg/datasource/sql/undo/builder/mysql_insert_undo_log_builder_test.go index c1a405a1b..47e6916c1 100644 --- a/pkg/datasource/sql/undo/builder/mysql_insert_undo_log_builder_test.go +++ b/pkg/datasource/sql/undo/builder/mysql_insert_undo_log_builder_test.go @@ -30,10 +30,11 @@ import ( "github.com/arana-db/parser/model" "github.com/DATA-DOG/go-sqlmock" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/mock" "github.com/seata/seata-go/pkg/datasource/sql/parser" "github.com/seata/seata-go/pkg/datasource/sql/types" - "github.com/stretchr/testify/assert" ) func TestBuildSelectSQLByInsert(t *testing.T) { diff --git a/pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder.go b/pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder.go index d203b4bb3..33fa5fdb9 100644 --- a/pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder.go +++ b/pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder.go @@ -24,6 +24,7 @@ import ( "strings" "github.com/arana-db/parser/ast" + "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/undo" "github.com/seata/seata-go/pkg/datasource/sql/undo/executor" diff --git a/pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder_test.go b/pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder_test.go index b3f41538e..89371b731 100644 --- a/pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder_test.go +++ b/pkg/datasource/sql/undo/builder/mysql_insertonduplicate_update_undo_log_builder_test.go @@ -23,9 +23,10 @@ import ( "database/sql/driver" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/parser" "github.com/seata/seata-go/pkg/datasource/sql/types" - "github.com/stretchr/testify/assert" ) func TestInsertOnDuplicateBuildBeforeImageSQL(t *testing.T) { diff --git a/pkg/datasource/sql/undo/builder/mysql_update_undo_log_builder.go b/pkg/datasource/sql/undo/builder/mysql_update_undo_log_builder.go index 7c971519b..7aebb081a 100644 --- a/pkg/datasource/sql/undo/builder/mysql_update_undo_log_builder.go +++ b/pkg/datasource/sql/undo/builder/mysql_update_undo_log_builder.go @@ -26,6 +26,7 @@ import ( "github.com/arana-db/parser/ast" "github.com/arana-db/parser/format" "github.com/arana-db/parser/model" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/types" diff --git a/pkg/datasource/sql/undo/builder/mysql_update_undo_log_builder_test.go b/pkg/datasource/sql/undo/builder/mysql_update_undo_log_builder_test.go index c6ee25eb2..279e8e010 100644 --- a/pkg/datasource/sql/undo/builder/mysql_update_undo_log_builder_test.go +++ b/pkg/datasource/sql/undo/builder/mysql_update_undo_log_builder_test.go @@ -33,8 +33,9 @@ import ( "github.com/seata/seata-go/pkg/datasource/sql/parser" _ "github.com/arana-db/parser/test_driver" - _ "github.com/seata/seata-go/pkg/util/log" "github.com/stretchr/testify/assert" + + _ "github.com/seata/seata-go/pkg/util/log" ) func TestBuildSelectSQLByUpdate(t *testing.T) { diff --git a/pkg/datasource/sql/undo/executor/executor.go b/pkg/datasource/sql/undo/executor/executor.go index ca0d4b185..94808a10e 100644 --- a/pkg/datasource/sql/undo/executor/executor.go +++ b/pkg/datasource/sql/undo/executor/executor.go @@ -25,6 +25,7 @@ import ( "strings" "github.com/goccy/go-json" + "github.com/seata/seata-go/pkg/datasource/sql/datasource" "github.com/seata/seata-go/pkg/datasource/sql/types" "github.com/seata/seata-go/pkg/datasource/sql/undo" diff --git a/pkg/datasource/sql/undo/mysql/default.go b/pkg/datasource/sql/undo/mysql/default.go index 8d4acfa05..149089957 100644 --- a/pkg/datasource/sql/undo/mysql/default.go +++ b/pkg/datasource/sql/undo/mysql/default.go @@ -19,6 +19,7 @@ package mysql import ( "github.com/pkg/errors" + "github.com/seata/seata-go/pkg/datasource/sql/undo" "github.com/seata/seata-go/pkg/datasource/sql/undo/base" ) diff --git a/pkg/datasource/sql/undo/parser/parser_json_test.go b/pkg/datasource/sql/undo/parser/parser_json_test.go index 4829af76e..88b1ccba9 100644 --- a/pkg/datasource/sql/undo/parser/parser_json_test.go +++ b/pkg/datasource/sql/undo/parser/parser_json_test.go @@ -20,8 +20,9 @@ package parser import ( "testing" - "github.com/seata/seata-go/pkg/datasource/sql/undo" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/datasource/sql/undo" ) func TestGetName(t *testing.T) { diff --git a/pkg/datasource/sql/undo_test.go b/pkg/datasource/sql/undo_test.go index 442e47d34..457de0725 100644 --- a/pkg/datasource/sql/undo_test.go +++ b/pkg/datasource/sql/undo_test.go @@ -22,9 +22,10 @@ import ( "database/sql" "testing" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/datasource/sql/undo/base" "github.com/seata/seata-go/pkg/datasource/sql/undo/mysql" - "github.com/stretchr/testify/assert" ) // TestBatchDeleteUndoLogs diff --git a/pkg/integration/dubbo/dubbo_transaction_filter.go b/pkg/integration/dubbo/dubbo_transaction_filter.go index 28bd4bc3d..b61c2edf7 100644 --- a/pkg/integration/dubbo/dubbo_transaction_filter.go +++ b/pkg/integration/dubbo/dubbo_transaction_filter.go @@ -25,6 +25,7 @@ import ( "dubbo.apache.org/dubbo-go/v3/common/extension" "dubbo.apache.org/dubbo-go/v3/filter" "dubbo.apache.org/dubbo-go/v3/protocol" + "github.com/seata/seata-go/pkg/constant" "github.com/seata/seata-go/pkg/tm" "github.com/seata/seata-go/pkg/util/log" diff --git a/pkg/protocol/codec/branch_commit_req_codec_test.go b/pkg/protocol/codec/branch_commit_req_codec_test.go index 3b01d27ac..a240f12f4 100644 --- a/pkg/protocol/codec/branch_commit_req_codec_test.go +++ b/pkg/protocol/codec/branch_commit_req_codec_test.go @@ -22,8 +22,9 @@ import ( model2 "github.com/seata/seata-go/pkg/protocol/branch" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestBranchCommitRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/branch_register_req_codec_test.go b/pkg/protocol/codec/branch_register_req_codec_test.go index 0b9c29b79..b8110e990 100644 --- a/pkg/protocol/codec/branch_register_req_codec_test.go +++ b/pkg/protocol/codec/branch_register_req_codec_test.go @@ -20,9 +20,10 @@ package codec import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/protocol/branch" "github.com/seata/seata-go/pkg/protocol/message" - "github.com/stretchr/testify/assert" ) func TestBranchRegisterRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/branch_register_response_codec_test.go b/pkg/protocol/codec/branch_register_response_codec_test.go index 5a6d9cdc6..61cf7ad3d 100644 --- a/pkg/protocol/codec/branch_register_response_codec_test.go +++ b/pkg/protocol/codec/branch_register_response_codec_test.go @@ -22,8 +22,9 @@ import ( serror "github.com/seata/seata-go/pkg/util/errors" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestBranchRegisterResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/branch_report_req_codec_test.go b/pkg/protocol/codec/branch_report_req_codec_test.go index 60a70708e..c696600a3 100644 --- a/pkg/protocol/codec/branch_report_req_codec_test.go +++ b/pkg/protocol/codec/branch_report_req_codec_test.go @@ -20,9 +20,10 @@ package codec import ( "testing" + "github.com/stretchr/testify/assert" + model2 "github.com/seata/seata-go/pkg/protocol/branch" "github.com/seata/seata-go/pkg/protocol/message" - "github.com/stretchr/testify/assert" ) func TestBranchReportRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/branch_rollback_req_codec_test.go b/pkg/protocol/codec/branch_rollback_req_codec_test.go index 730ecca63..8da865804 100644 --- a/pkg/protocol/codec/branch_rollback_req_codec_test.go +++ b/pkg/protocol/codec/branch_rollback_req_codec_test.go @@ -22,8 +22,9 @@ import ( model2 "github.com/seata/seata-go/pkg/protocol/branch" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestBranchRollbackRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/branch_rollback_response_codec_test.go b/pkg/protocol/codec/branch_rollback_response_codec_test.go index de923135f..588c9dbe4 100644 --- a/pkg/protocol/codec/branch_rollback_response_codec_test.go +++ b/pkg/protocol/codec/branch_rollback_response_codec_test.go @@ -24,8 +24,9 @@ import ( model2 "github.com/seata/seata-go/pkg/protocol/branch" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestBranchRollbackResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/branch_statue_report_response_codec_test.go b/pkg/protocol/codec/branch_statue_report_response_codec_test.go index 95a92fc98..efb05de52 100644 --- a/pkg/protocol/codec/branch_statue_report_response_codec_test.go +++ b/pkg/protocol/codec/branch_statue_report_response_codec_test.go @@ -20,9 +20,10 @@ package codec import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/protocol/message" serror "github.com/seata/seata-go/pkg/util/errors" - "github.com/stretchr/testify/assert" ) func TestBranchReportResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/codec.go b/pkg/protocol/codec/codec.go index 467c4bc8d..35321e270 100644 --- a/pkg/protocol/codec/codec.go +++ b/pkg/protocol/codec/codec.go @@ -21,9 +21,10 @@ import ( "bytes" "sync" + "vimagination.zapto.org/byteio" + "github.com/seata/seata-go/pkg/protocol/message" "github.com/seata/seata-go/pkg/util/log" - "vimagination.zapto.org/byteio" ) type CodecType byte diff --git a/pkg/protocol/codec/global_begin_request_codec_test.go b/pkg/protocol/codec/global_begin_request_codec_test.go index 7d96c8fd1..d053c01c7 100644 --- a/pkg/protocol/codec/global_begin_request_codec_test.go +++ b/pkg/protocol/codec/global_begin_request_codec_test.go @@ -21,8 +21,9 @@ import ( "testing" "time" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalBeginRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_commit_req_codec_test.go b/pkg/protocol/codec/global_commit_req_codec_test.go index 991313566..1d643f696 100644 --- a/pkg/protocol/codec/global_commit_req_codec_test.go +++ b/pkg/protocol/codec/global_commit_req_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalCommitRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_commit_response_codec_test.go b/pkg/protocol/codec/global_commit_response_codec_test.go index 12c51efe6..48d4d05e3 100644 --- a/pkg/protocol/codec/global_commit_response_codec_test.go +++ b/pkg/protocol/codec/global_commit_response_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalCommitResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_lock_query_req_codec_test.go b/pkg/protocol/codec/global_lock_query_req_codec_test.go index e426b9b37..391d7ddff 100644 --- a/pkg/protocol/codec/global_lock_query_req_codec_test.go +++ b/pkg/protocol/codec/global_lock_query_req_codec_test.go @@ -20,9 +20,10 @@ package codec import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/protocol/branch" "github.com/seata/seata-go/pkg/protocol/message" - "github.com/stretchr/testify/assert" ) func TestGlobalLockQueryRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_lock_query_resp_codec_test.go b/pkg/protocol/codec/global_lock_query_resp_codec_test.go index dde65cc7f..0dcac4d1b 100644 --- a/pkg/protocol/codec/global_lock_query_resp_codec_test.go +++ b/pkg/protocol/codec/global_lock_query_resp_codec_test.go @@ -22,8 +22,9 @@ import ( serror "github.com/seata/seata-go/pkg/util/errors" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalLockQueryResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_report_request_codec_test.go b/pkg/protocol/codec/global_report_request_codec_test.go index a06a7e2c4..1b6d63eab 100644 --- a/pkg/protocol/codec/global_report_request_codec_test.go +++ b/pkg/protocol/codec/global_report_request_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalReportRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_report_response_codec_test.go b/pkg/protocol/codec/global_report_response_codec_test.go index 3e03d64f8..b7a9a2e0e 100644 --- a/pkg/protocol/codec/global_report_response_codec_test.go +++ b/pkg/protocol/codec/global_report_response_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalReportResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_rollback_req_codec_test.go b/pkg/protocol/codec/global_rollback_req_codec_test.go index 692f8e683..eac033fac 100644 --- a/pkg/protocol/codec/global_rollback_req_codec_test.go +++ b/pkg/protocol/codec/global_rollback_req_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalRollbackRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_rollback_response_codec_test.go b/pkg/protocol/codec/global_rollback_response_codec_test.go index 75dac1c72..a886af26c 100644 --- a/pkg/protocol/codec/global_rollback_response_codec_test.go +++ b/pkg/protocol/codec/global_rollback_response_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalRollbackResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_status_req_codec_test.go b/pkg/protocol/codec/global_status_req_codec_test.go index cb0075636..b333f429c 100644 --- a/pkg/protocol/codec/global_status_req_codec_test.go +++ b/pkg/protocol/codec/global_status_req_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalStatusRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/global_status_response_codec_test.go b/pkg/protocol/codec/global_status_response_codec_test.go index 95bc538fb..43e803378 100644 --- a/pkg/protocol/codec/global_status_response_codec_test.go +++ b/pkg/protocol/codec/global_status_response_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestGlobalStatusResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/register_rm_request_codec_test.go b/pkg/protocol/codec/register_rm_request_codec_test.go index fcaf4ab4f..e45fa0563 100644 --- a/pkg/protocol/codec/register_rm_request_codec_test.go +++ b/pkg/protocol/codec/register_rm_request_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestRegisterRMRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/register_rm_response_codec_test.go b/pkg/protocol/codec/register_rm_response_codec_test.go index 3b810b282..f2ea5f2f5 100644 --- a/pkg/protocol/codec/register_rm_response_codec_test.go +++ b/pkg/protocol/codec/register_rm_response_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestRegisterRMResponseCodec(t *testing.T) { diff --git a/pkg/protocol/codec/register_tm_request_codec_test.go b/pkg/protocol/codec/register_tm_request_codec_test.go index 19d630c3a..a920b3a86 100644 --- a/pkg/protocol/codec/register_tm_request_codec_test.go +++ b/pkg/protocol/codec/register_tm_request_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestRegisterTMRequestCodec(t *testing.T) { diff --git a/pkg/protocol/codec/register_tm_response_codec_test.go b/pkg/protocol/codec/register_tm_response_codec_test.go index 47d938e67..9d56322f9 100644 --- a/pkg/protocol/codec/register_tm_response_codec_test.go +++ b/pkg/protocol/codec/register_tm_response_codec_test.go @@ -20,8 +20,9 @@ package codec import ( "testing" - "github.com/seata/seata-go/pkg/protocol/message" "github.com/stretchr/testify/assert" + + "github.com/seata/seata-go/pkg/protocol/message" ) func TestRegisterTMResponseCodec(t *testing.T) { diff --git a/pkg/rm/rm_api_test.go b/pkg/rm/rm_api_test.go index 1197ea1d1..eb8242710 100644 --- a/pkg/rm/rm_api_test.go +++ b/pkg/rm/rm_api_test.go @@ -23,6 +23,7 @@ import ( "sync" "github.com/golang/mock/gomock" + "github.com/seata/seata-go/pkg/protocol/branch" ) diff --git a/pkg/rm/tcc/fence/fence_driver.go b/pkg/rm/tcc/fence/fence_driver.go index 8e86093d3..cd8865870 100644 --- a/pkg/rm/tcc/fence/fence_driver.go +++ b/pkg/rm/tcc/fence/fence_driver.go @@ -24,6 +24,7 @@ import ( "github.com/go-sql-driver/mysql" "github.com/pkg/errors" + "github.com/seata/seata-go/pkg/util/log" ) diff --git a/pkg/rm/tcc/fence/fence_driver_conn.go b/pkg/rm/tcc/fence/fence_driver_conn.go index 3c71acd03..28dfe7c8f 100644 --- a/pkg/rm/tcc/fence/fence_driver_conn.go +++ b/pkg/rm/tcc/fence/fence_driver_conn.go @@ -23,6 +23,7 @@ import ( "database/sql/driver" "github.com/pkg/errors" + "github.com/seata/seata-go/pkg/tm" "github.com/seata/seata-go/pkg/util/log" ) diff --git a/pkg/rm/tcc/tcc_service.go b/pkg/rm/tcc/tcc_service.go index 9694a32fa..c65610380 100644 --- a/pkg/rm/tcc/tcc_service.go +++ b/pkg/rm/tcc/tcc_service.go @@ -26,6 +26,7 @@ import ( "time" gostnet "github.com/dubbogo/gost/net" + "github.com/seata/seata-go/pkg/constant" "github.com/seata/seata-go/pkg/protocol/branch" "github.com/seata/seata-go/pkg/rm" diff --git a/pkg/rm/tcc/tcc_service_test.go b/pkg/rm/tcc/tcc_service_test.go index 792cf12d5..34b0c0dd8 100644 --- a/pkg/rm/tcc/tcc_service_test.go +++ b/pkg/rm/tcc/tcc_service_test.go @@ -29,9 +29,10 @@ import ( "github.com/agiledragon/gomonkey/v2" gostnet "github.com/dubbogo/gost/net" - "github.com/seata/seata-go/pkg/constant" "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/constant" + "github.com/seata/seata-go/pkg/rm" "github.com/seata/seata-go/pkg/tm" "github.com/seata/seata-go/pkg/util/log" diff --git a/pkg/tm/global_transaction_test.go b/pkg/tm/global_transaction_test.go index d9c43ab52..4252520b8 100644 --- a/pkg/tm/global_transaction_test.go +++ b/pkg/tm/global_transaction_test.go @@ -26,9 +26,10 @@ import ( "github.com/agiledragon/gomonkey/v2" "github.com/pkg/errors" - "github.com/seata/seata-go/pkg/util/log" "github.com/stretchr/testify/assert" + "github.com/seata/seata-go/pkg/util/log" + "github.com/seata/seata-go/pkg/protocol/message" "github.com/seata/seata-go/pkg/remoting/getty" )