fix: satisfy revive unused-parameter and gofumpt in #3493 review findings
parent
2dd36212d6
commit
4b0dc3b687
|
|
@ -59,15 +59,21 @@ func TestResolveParentChunksResolvesSharedKBParentsAcrossTenants(t *testing.T) {
|
|||
// All chunks belong to workspace 2; the caller is workspace 1.
|
||||
repo := &tenantScopedChunkRepo{expandChunkRepo: &expandChunkRepo{
|
||||
chunks: map[string]*types.Chunk{
|
||||
"parent": {ID: "parent", TenantID: 2, ChunkType: types.ChunkTypeParentText,
|
||||
Content: "shared parent body with "},
|
||||
"child": {ID: "child", TenantID: 2, ChunkType: types.ChunkTypeText,
|
||||
ParentChunkID: "parent", Content: "shared child body"},
|
||||
"parent": {
|
||||
ID: "parent", TenantID: 2, ChunkType: types.ChunkTypeParentText,
|
||||
Content: "shared parent body with ",
|
||||
},
|
||||
"child": {
|
||||
ID: "child", TenantID: 2, ChunkType: types.ChunkTypeText,
|
||||
ParentChunkID: "parent", Content: "shared child body",
|
||||
},
|
||||
},
|
||||
children: map[string][]*types.Chunk{
|
||||
"child": {
|
||||
{ID: "imageChild", TenantID: 2, ParentChunkID: "child",
|
||||
ChunkType: types.ChunkTypeImageOCR, ImageInfo: string(imageInfo), IsEnabled: true},
|
||||
{
|
||||
ID: "imageChild", TenantID: 2, ParentChunkID: "child",
|
||||
ChunkType: types.ChunkTypeImageOCR, ImageInfo: string(imageInfo), IsEnabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ func CollectImageInfoByChunkIDs(
|
|||
tenantID uint64,
|
||||
chunkIDs []string,
|
||||
) map[string]string {
|
||||
return collectImageInfoByChunkIDs(ctx, chunkIDs, func(parentIDs []string) ([]*types.Chunk, error) {
|
||||
return collectImageInfoByChunkIDs(chunkIDs, func(parentIDs []string) ([]*types.Chunk, error) {
|
||||
return chunkRepo.ListChunksByParentIDs(ctx, tenantID, parentIDs)
|
||||
})
|
||||
}
|
||||
|
|
@ -72,13 +72,12 @@ func CollectImageInfoByChunkIDsOnly(
|
|||
chunkRepo interfaces.ChunkRepository,
|
||||
chunkIDs []string,
|
||||
) map[string]string {
|
||||
return collectImageInfoByChunkIDs(ctx, chunkIDs, func(parentIDs []string) ([]*types.Chunk, error) {
|
||||
return collectImageInfoByChunkIDs(chunkIDs, func(parentIDs []string) ([]*types.Chunk, error) {
|
||||
return chunkRepo.ListChunksByParentIDsOnly(ctx, parentIDs)
|
||||
})
|
||||
}
|
||||
|
||||
func collectImageInfoByChunkIDs(
|
||||
ctx context.Context,
|
||||
chunkIDs []string,
|
||||
listChildren func(parentIDs []string) ([]*types.Chunk, error),
|
||||
) map[string]string {
|
||||
|
|
|
|||
Loading…
Reference in New Issue