From af9a14de2c5807502fbf6ff9afc16f11c3959076 Mon Sep 17 00:00:00 2001 From: Sergey Date: Thu, 24 Aug 2023 19:23:04 +0500 Subject: [PATCH] Fix imports --- core/block/editor/basic/extract_objects_test.go | 3 +-- core/block/editor/smartblock/smartblock_test.go | 7 ++++--- core/block/editor/template_test.go | 2 +- .../import/converter/mock_converter/mock_Converter.go | 5 ++--- core/block/import/objectidgetter.go | 2 +- core/block/restriction/dataview_test.go | 6 ++++-- core/block/restriction/fixture_test.go | 6 ++++-- core/block/restriction/mock_restriction/mock_Service.go | 3 +-- core/block/restriction/object_test.go | 5 +++-- core/block/restriction/service.go | 2 +- core/block/source/service.go | 2 +- core/event/mock_event/mock_Sender.go | 1 - core/files/files.go | 2 +- core/relation/relationutils/objecttype.go | 2 +- core/wallet/mock_wallet/mock_Wallet.go | 2 -- util/pbtypes/pbtypes.go | 2 +- util/testMock/mockCreator/creator_mock.go | 5 +++-- util/testMock/objectstore_mock.go | 5 +++-- 18 files changed, 32 insertions(+), 30 deletions(-) diff --git a/core/block/editor/basic/extract_objects_test.go b/core/block/editor/basic/extract_objects_test.go index 08f62d3b8..47eab67f8 100644 --- a/core/block/editor/basic/extract_objects_test.go +++ b/core/block/editor/basic/extract_objects_test.go @@ -6,10 +6,9 @@ import ( "github.com/globalsign/mgo/bson" "github.com/gogo/protobuf/types" - "go.uber.org/mock/gomock" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.uber.org/mock/gomock" "github.com/anyproto/anytype-heart/core/block/editor/converter" "github.com/anyproto/anytype-heart/core/block/editor/smartblock/smarttest" diff --git a/core/block/editor/smartblock/smartblock_test.go b/core/block/editor/smartblock/smartblock_test.go index cc3d7ae4a..718237c78 100644 --- a/core/block/editor/smartblock/smartblock_test.go +++ b/core/block/editor/smartblock/smartblock_test.go @@ -10,8 +10,11 @@ import ( "go.uber.org/mock/gomock" "github.com/anyproto/anytype-heart/core/block/editor/state" + "github.com/anyproto/anytype-heart/core/block/restriction" + "github.com/anyproto/anytype-heart/core/block/restriction/mock_restriction" "github.com/anyproto/anytype-heart/core/block/simple" "github.com/anyproto/anytype-heart/core/event/mock_event" + "github.com/anyproto/anytype-heart/core/relation/mock_relation" "github.com/anyproto/anytype-heart/core/session" "github.com/anyproto/anytype-heart/pb" "github.com/anyproto/anytype-heart/pkg/lib/bundle" @@ -22,12 +25,10 @@ import ( "github.com/anyproto/anytype-heart/util/pbtypes" "github.com/anyproto/anytype-heart/util/testMock" "github.com/anyproto/anytype-heart/util/testMock/mockSource" - "github.com/anyproto/anytype-heart/core/block/restriction" - "github.com/anyproto/anytype-heart/core/block/restriction/mock_restriction" + _ "github.com/anyproto/anytype-heart/core/block/simple/base" _ "github.com/anyproto/anytype-heart/core/block/simple/link" _ "github.com/anyproto/anytype-heart/core/block/simple/text" - "github.com/anyproto/anytype-heart/core/relation/mock_relation" ) func TestSmartBlock_Init(t *testing.T) { diff --git a/core/block/editor/template_test.go b/core/block/editor/template_test.go index 9139f9cf7..1b9d95aa8 100644 --- a/core/block/editor/template_test.go +++ b/core/block/editor/template_test.go @@ -3,6 +3,7 @@ package editor import ( "testing" + "github.com/gogo/protobuf/types" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" @@ -16,7 +17,6 @@ import ( "github.com/anyproto/anytype-heart/pkg/lib/pb/model" "github.com/anyproto/anytype-heart/util/pbtypes" "github.com/anyproto/anytype-heart/util/testMock" - "github.com/gogo/protobuf/types" ) func NewTemplateTest(t *testing.T, ctrl *gomock.Controller, templateName string) (*Template, error) { diff --git a/core/block/import/converter/mock_converter/mock_Converter.go b/core/block/import/converter/mock_converter/mock_Converter.go index 1b8ca4cff..e4b1aa4a9 100644 --- a/core/block/import/converter/mock_converter/mock_Converter.go +++ b/core/block/import/converter/mock_converter/mock_Converter.go @@ -5,12 +5,11 @@ package mock_converter import ( context "context" - converter "github.com/anyproto/anytype-heart/core/block/import/converter" mock "github.com/stretchr/testify/mock" - pb "github.com/anyproto/anytype-heart/pb" - + converter "github.com/anyproto/anytype-heart/core/block/import/converter" process "github.com/anyproto/anytype-heart/core/block/process" + pb "github.com/anyproto/anytype-heart/pb" ) // MockConverter is an autogenerated mock type for the Converter type diff --git a/core/block/import/objectidgetter.go b/core/block/import/objectidgetter.go index 8217c048e..bf0978d41 100644 --- a/core/block/import/objectidgetter.go +++ b/core/block/import/objectidgetter.go @@ -6,11 +6,11 @@ import ( "time" "github.com/anyproto/any-sync/commonspace/object/tree/treestorage" - "github.com/anyproto/anytype-heart/core/block/uniquekey" "github.com/gogo/protobuf/types" "github.com/anyproto/anytype-heart/core/block" "github.com/anyproto/anytype-heart/core/block/import/converter" + "github.com/anyproto/anytype-heart/core/block/uniquekey" "github.com/anyproto/anytype-heart/pkg/lib/bundle" "github.com/anyproto/anytype-heart/pkg/lib/core" sb "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" diff --git a/core/block/restriction/dataview_test.go b/core/block/restriction/dataview_test.go index 2787fb87b..c68e2f7be 100644 --- a/core/block/restriction/dataview_test.go +++ b/core/block/restriction/dataview_test.go @@ -1,11 +1,13 @@ package restriction import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/anyproto/anytype-heart/pkg/lib/bundle" "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" "github.com/anyproto/anytype-heart/pkg/lib/pb/model" - "github.com/stretchr/testify/assert" - "testing" ) func TestService_DataviewRestrictions(t *testing.T) { diff --git a/core/block/restriction/fixture_test.go b/core/block/restriction/fixture_test.go index 2a7949e7d..f233ae41c 100644 --- a/core/block/restriction/fixture_test.go +++ b/core/block/restriction/fixture_test.go @@ -2,15 +2,17 @@ package restriction import ( "fmt" + "testing" + "github.com/anyproto/any-sync/app" + "github.com/stretchr/testify/require" + "github.com/anyproto/anytype-heart/core/block/uniquekey" "github.com/anyproto/anytype-heart/pkg/lib/bundle" "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" "github.com/anyproto/anytype-heart/pkg/lib/localstore/objectstore/mock_objectstore" "github.com/anyproto/anytype-heart/pkg/lib/pb/model" "github.com/anyproto/anytype-heart/space/typeprovider/mock_typeprovider" - "github.com/stretchr/testify/require" - "testing" ) type fixture struct { diff --git a/core/block/restriction/mock_restriction/mock_Service.go b/core/block/restriction/mock_restriction/mock_Service.go index 7365b735b..41a2d2795 100644 --- a/core/block/restriction/mock_restriction/mock_Service.go +++ b/core/block/restriction/mock_restriction/mock_Service.go @@ -6,9 +6,8 @@ import ( app "github.com/anyproto/any-sync/app" mock "github.com/stretchr/testify/mock" - model "github.com/anyproto/anytype-heart/pkg/lib/pb/model" - restriction "github.com/anyproto/anytype-heart/core/block/restriction" + model "github.com/anyproto/anytype-heart/pkg/lib/pb/model" ) // MockService is an autogenerated mock type for the Service type diff --git a/core/block/restriction/object_test.go b/core/block/restriction/object_test.go index 3a0e7bfce..2b9551bf8 100644 --- a/core/block/restriction/object_test.go +++ b/core/block/restriction/object_test.go @@ -3,10 +3,11 @@ package restriction import ( "testing" - "github.com/anyproto/anytype-heart/pkg/lib/bundle" - "github.com/anyproto/anytype-heart/pkg/lib/pb/model" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + + "github.com/anyproto/anytype-heart/pkg/lib/bundle" + "github.com/anyproto/anytype-heart/pkg/lib/pb/model" ) // TODO Use constructors instead for initializing restrictionHolder structures by hand. See givenObjectType and givenRelation diff --git a/core/block/restriction/service.go b/core/block/restriction/service.go index 612e47986..11718a279 100644 --- a/core/block/restriction/service.go +++ b/core/block/restriction/service.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/anyproto/any-sync/app" - "github.com/anyproto/anytype-heart/core/block/uniquekey" + "github.com/anyproto/anytype-heart/core/block/uniquekey" "github.com/anyproto/anytype-heart/pkg/lib/bundle" "github.com/anyproto/anytype-heart/pkg/lib/localstore/objectstore" "github.com/anyproto/anytype-heart/pkg/lib/logging" diff --git a/core/block/source/service.go b/core/block/source/service.go index f5b6d87a4..8ea3b19cf 100644 --- a/core/block/source/service.go +++ b/core/block/source/service.go @@ -11,11 +11,11 @@ import ( "github.com/anyproto/any-sync/commonspace/object/tree/objecttree" "github.com/anyproto/any-sync/commonspace/object/tree/synctree/updatelistener" "github.com/anyproto/any-sync/commonspace/objecttreebuilder" - "github.com/anyproto/anytype-heart/core/relation" "github.com/gogo/protobuf/types" "github.com/anyproto/anytype-heart/core/block/editor/state" "github.com/anyproto/anytype-heart/core/files" + "github.com/anyproto/anytype-heart/core/relation" "github.com/anyproto/anytype-heart/pkg/lib/core" "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" "github.com/anyproto/anytype-heart/pkg/lib/localstore/addr" diff --git a/core/event/mock_event/mock_Sender.go b/core/event/mock_event/mock_Sender.go index 11dfb6f02..2fc85e011 100644 --- a/core/event/mock_event/mock_Sender.go +++ b/core/event/mock_event/mock_Sender.go @@ -4,7 +4,6 @@ package mock_event import ( app "github.com/anyproto/any-sync/app" - mock "github.com/stretchr/testify/mock" pb "github.com/anyproto/anytype-heart/pb" diff --git a/core/files/files.go b/core/files/files.go index 46cdb0df5..24ddc2636 100644 --- a/core/files/files.go +++ b/core/files/files.go @@ -15,7 +15,6 @@ import ( "github.com/anyproto/any-sync/app" "github.com/anyproto/any-sync/commonfile/fileservice" "github.com/anyproto/any-sync/commonspace/syncstatus" - "github.com/anyproto/anytype-heart/pkg/lib/core" "github.com/gogo/protobuf/proto" uio "github.com/ipfs/boxo/ipld/unixfs/io" "github.com/ipfs/go-cid" @@ -29,6 +28,7 @@ import ( "github.com/anyproto/anytype-heart/core/filestorage/filesync" "github.com/anyproto/anytype-heart/pb" "github.com/anyproto/anytype-heart/pkg/lib/bundle" + "github.com/anyproto/anytype-heart/pkg/lib/core" "github.com/anyproto/anytype-heart/pkg/lib/crypto/symmetric" "github.com/anyproto/anytype-heart/pkg/lib/crypto/symmetric/cfb" "github.com/anyproto/anytype-heart/pkg/lib/crypto/symmetric/gcm" diff --git a/core/relation/relationutils/objecttype.go b/core/relation/relationutils/objecttype.go index 4cb612668..e11a4adde 100644 --- a/core/relation/relationutils/objecttype.go +++ b/core/relation/relationutils/objecttype.go @@ -1,9 +1,9 @@ package relationutils import ( - "github.com/anyproto/anytype-heart/core/block/uniquekey" "github.com/gogo/protobuf/types" + "github.com/anyproto/anytype-heart/core/block/uniquekey" "github.com/anyproto/anytype-heart/pkg/lib/bundle" "github.com/anyproto/anytype-heart/pkg/lib/localstore/addr" "github.com/anyproto/anytype-heart/pkg/lib/pb/model" diff --git a/core/wallet/mock_wallet/mock_Wallet.go b/core/wallet/mock_wallet/mock_Wallet.go index b4c0d8dc7..a7fe4044f 100644 --- a/core/wallet/mock_wallet/mock_Wallet.go +++ b/core/wallet/mock_wallet/mock_Wallet.go @@ -5,9 +5,7 @@ package mock_wallet import ( app "github.com/anyproto/any-sync/app" accountdata "github.com/anyproto/any-sync/commonspace/object/accountdata" - crypto "github.com/anyproto/any-sync/util/crypto" - mock "github.com/stretchr/testify/mock" ) diff --git a/util/pbtypes/pbtypes.go b/util/pbtypes/pbtypes.go index 4900b9095..4de7a241a 100644 --- a/util/pbtypes/pbtypes.go +++ b/util/pbtypes/pbtypes.go @@ -4,11 +4,11 @@ import ( "fmt" "strings" - "github.com/anyproto/anytype-heart/pkg/lib/localstore/addr" "github.com/gogo/protobuf/jsonpb" "github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/types" + "github.com/anyproto/anytype-heart/pkg/lib/localstore/addr" "github.com/anyproto/anytype-heart/pkg/lib/pb/model" "github.com/anyproto/anytype-heart/util/slice" ) diff --git a/util/testMock/mockCreator/creator_mock.go b/util/testMock/mockCreator/creator_mock.go index dfbacef98..4cce53eeb 100644 --- a/util/testMock/mockCreator/creator_mock.go +++ b/util/testMock/mockCreator/creator_mock.go @@ -9,11 +9,12 @@ import ( reflect "reflect" app "github.com/anyproto/any-sync/app" + types "github.com/gogo/protobuf/types" + gomock "go.uber.org/mock/gomock" + state "github.com/anyproto/anytype-heart/core/block/editor/state" pb "github.com/anyproto/anytype-heart/pb" smartblock "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" - types "github.com/gogo/protobuf/types" - gomock "go.uber.org/mock/gomock" ) // MockService is a mock of Service interface. diff --git a/util/testMock/objectstore_mock.go b/util/testMock/objectstore_mock.go index 7bf24f276..0d9f9ca13 100644 --- a/util/testMock/objectstore_mock.go +++ b/util/testMock/objectstore_mock.go @@ -10,12 +10,13 @@ import ( app "github.com/anyproto/any-sync/app" coordinatorproto "github.com/anyproto/any-sync/coordinator/coordinatorproto" + types "github.com/gogo/protobuf/types" + gomock "go.uber.org/mock/gomock" + smartblock "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" database "github.com/anyproto/anytype-heart/pkg/lib/database" ftsearch "github.com/anyproto/anytype-heart/pkg/lib/localstore/ftsearch" model "github.com/anyproto/anytype-heart/pkg/lib/pb/model" - types "github.com/gogo/protobuf/types" - gomock "go.uber.org/mock/gomock" ) // MockObjectStore is a mock of ObjectStore interface.