diff --git a/builder/store/database/tag.go b/builder/store/database/tag.go index 9e51a241..3c0b03fa 100644 --- a/builder/store/database/tag.go +++ b/builder/store/database/tag.go @@ -63,8 +63,6 @@ const ( PromptTagScope TagScope = "prompt" ) -const defaultTagGroup = "" - type Tag struct { ID int64 `bun:",pk,autoincrement" json:"id"` Name string `bun:",notnull" json:"name" yaml:"name"` diff --git a/builder/store/database/tag_test.go b/builder/store/database/tag_test.go index e60113bb..777b4f4c 100644 --- a/builder/store/database/tag_test.go +++ b/builder/store/database/tag_test.go @@ -398,12 +398,12 @@ func TestTagStore_SetMetaTags(t *testing.T) { BuiltIn: true, ShowName: "", }) - repoTags, err := ts.SetMetaTags(ctx, types.ModelRepo, userName, repoName, tags) + _, err = ts.SetMetaTags(ctx, types.ModelRepo, userName, repoName, tags) // should report err as framework tag is not allowed require.NotEmpty(t, err) tags = tags[:1] - repoTags, err = ts.SetMetaTags(ctx, types.ModelRepo, userName, repoName, tags) + repoTags, err := ts.SetMetaTags(ctx, types.ModelRepo, userName, repoName, tags) require.Empty(t, err) require.Len(t, repoTags, 1) } @@ -528,7 +528,8 @@ func TestTagStore_RemoveRepoTags(t *testing.T) { require.Empty(t, err) require.NotNil(t, repo) // set repo tags - ts.UpsertRepoTags(ctx, repo.ID, []int64{}, []int64{tag1.ID, tag2.ID}) + err = ts.UpsertRepoTags(ctx, repo.ID, []int64{}, []int64{tag1.ID, tag2.ID}) + require.Empty(t, err) removeTagIds := make([]int64, 0, 1) removeTagIds = append(removeTagIds, tag2.ID)