Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: remove unnecessary named return values (#798)

Yilong Lib5fe44765496
diff --git a/store/activity.go b/store/activity.go
index 6f855a2fb5..ba7e2a324d 100644
--- a/store/activity.go
+++ b/store/activity.go
@@ -177,7 +177,7 @@ func createActivity(ctx context.Context, tx *sql.Tx, create *api.ActivityCreate)
return &activity, nil
}
-func findActivityList(ctx context.Context, tx *sql.Tx, find *api.ActivityFind) (_ []*api.Activity, err error) {
+func findActivityList(ctx context.Context, tx *sql.Tx, find *api.ActivityFind) ([]*api.Activity, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/anomaly.go b/store/anomaly.go
index 68e368d1fb..fcf6b28a14 100644
--- a/store/anomaly.go
+++ b/store/anomaly.go
@@ -168,7 +168,7 @@ func createAnomaly(ctx context.Context, tx *sql.Tx, upsert *api.AnomalyUpsert) (
return nil, err
}
-func findAnomalyList(ctx context.Context, tx *sql.Tx, find *api.AnomalyFind) (_ []*api.Anomaly, err error) {
+func findAnomalyList(ctx context.Context, tx *sql.Tx, find *api.AnomalyFind) ([]*api.Anomaly, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.InstanceID; v != nil {
diff --git a/store/backup.go b/store/backup.go
index 9e3f62b075..fbe4ec29ec 100644
--- a/store/backup.go
+++ b/store/backup.go
@@ -162,7 +162,7 @@ func (s *BackupService) createBackup(ctx context.Context, tx *sql.Tx, create *ap
return &backup, nil
}
-func (s *BackupService) findBackupList(ctx context.Context, tx *sql.Tx, find *api.BackupFind) (_ []*api.Backup, err error) {
+func (s *BackupService) findBackupList(ctx context.Context, tx *sql.Tx, find *api.BackupFind) ([]*api.Backup, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
@@ -303,7 +303,7 @@ func (s *BackupService) FindBackupSetting(ctx context.Context, find *api.BackupS
return list[0], nil
}
-func (s *BackupService) findBackupSetting(ctx context.Context, tx *sql.Tx, find *api.BackupSettingFind) (_ []*api.BackupSetting, err error) {
+func (s *BackupService) findBackupSetting(ctx context.Context, tx *sql.Tx, find *api.BackupSettingFind) ([]*api.BackupSetting, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/bookmark.go b/store/bookmark.go
index b0efe469a5..89bf178f28 100644
--- a/store/bookmark.go
+++ b/store/bookmark.go
@@ -145,7 +145,7 @@ func createBookmark(ctx context.Context, tx *sql.Tx, create *api.BookmarkCreate)
return &bookmark, nil
}
-func findBookmarkList(ctx context.Context, tx *sql.Tx, find *api.BookmarkFind) (_ []*api.Bookmark, err error) {
+func findBookmarkList(ctx context.Context, tx *sql.Tx, find *api.BookmarkFind) ([]*api.Bookmark, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/column.go b/store/column.go
index 57429a2620..fef680bcf7 100644
--- a/store/column.go
+++ b/store/column.go
@@ -182,7 +182,7 @@ func (s *ColumnService) createColumn(ctx context.Context, tx *sql.Tx, create *ap
return &column, nil
}
-func (s *ColumnService) findColumnList(ctx context.Context, tx *sql.Tx, find *api.ColumnFind) (_ []*api.Column, err error) {
+func (s *ColumnService) findColumnList(ctx context.Context, tx *sql.Tx, find *api.ColumnFind) ([]*api.Column, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/data_source.go b/store/data_source.go
index fdeab2e2a8..36842c44ab 100644
--- a/store/data_source.go
+++ b/store/data_source.go
@@ -165,7 +165,7 @@ func (s *DataSourceService) createDataSource(ctx context.Context, tx *sql.Tx, cr
return &dataSource, nil
}
-func (s *DataSourceService) findDataSourceList(ctx context.Context, tx *sql.Tx, find *api.DataSourceFind) (_ []*api.DataSource, err error) {
+func (s *DataSourceService) findDataSourceList(ctx context.Context, tx *sql.Tx, find *api.DataSourceFind) ([]*api.DataSource, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/database.go b/store/database.go
index b45963f6de..d97cac8bc2 100644
--- a/store/database.go
+++ b/store/database.go
@@ -252,7 +252,7 @@ func (s *DatabaseService) createDatabase(ctx context.Context, tx *sql.Tx, create
return &database, nil
}
-func (s *DatabaseService) findDatabaseList(ctx context.Context, tx *sql.Tx, find *api.DatabaseFind) (_ []*api.Database, err error) {
+func (s *DatabaseService) findDatabaseList(ctx context.Context, tx *sql.Tx, find *api.DatabaseFind) ([]*api.Database, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/environment.go b/store/environment.go
index 82ca10b7f6..dbe4f132f0 100644
--- a/store/environment.go
+++ b/store/environment.go
@@ -205,7 +205,7 @@ func (s *EnvironmentService) createEnvironment(ctx context.Context, tx *sql.Tx,
return &environment, nil
}
-func (s *EnvironmentService) findEnvironmentList(ctx context.Context, tx *sql.Tx, find *api.EnvironmentFind) (_ []*api.Environment, err error) {
+func (s *EnvironmentService) findEnvironmentList(ctx context.Context, tx *sql.Tx, find *api.EnvironmentFind) ([]*api.Environment, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/inbox.go b/store/inbox.go
index 3c7c9b4921..583c468d2d 100644
--- a/store/inbox.go
+++ b/store/inbox.go
@@ -204,7 +204,7 @@ func (s *InboxService) createInbox(ctx context.Context, tx *sql.Tx, create *api.
return &inbox, nil
}
-func findInboxList(ctx context.Context, tx *sql.Tx, find *api.InboxFind) (_ []*api.Inbox, err error) {
+func findInboxList(ctx context.Context, tx *sql.Tx, find *api.InboxFind) ([]*api.Inbox, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
where = append(where, "inbox.activity_id = activity.id")
diff --git a/store/instance.go b/store/instance.go
index 8750c8c1ac..42996ee972 100644
--- a/store/instance.go
+++ b/store/instance.go
@@ -249,7 +249,7 @@ func createInstance(ctx context.Context, tx *sql.Tx, create *api.InstanceCreate)
return &instance, nil
}
-func findInstanceList(ctx context.Context, tx *sql.Tx, find *api.InstanceFind) (_ []*api.Instance, err error) {
+func findInstanceList(ctx context.Context, tx *sql.Tx, find *api.InstanceFind) ([]*api.Instance, error) {
where, args := findInstanceQuery(find)
rows, err := tx.QueryContext(ctx, `
diff --git a/store/instance_user.go b/store/instance_user.go
index 265d170636..e176fa6eaf 100644
--- a/store/instance_user.go
+++ b/store/instance_user.go
@@ -122,7 +122,7 @@ func upsertInstanceUser(ctx context.Context, tx *sql.Tx, upsert *api.InstanceUse
return nil, err
}
-func findInstanceUserList(ctx context.Context, tx *sql.Tx, find *api.InstanceUserFind) (_ []*api.InstanceUser, err error) {
+func findInstanceUserList(ctx context.Context, tx *sql.Tx, find *api.InstanceUserFind) ([]*api.InstanceUser, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
where, args = append(where, "instance_id = $1"), append(args, find.InstanceID)
diff --git a/store/issue.go b/store/issue.go
index 8bcc28223c..423f59f400 100644
--- a/store/issue.go
+++ b/store/issue.go
@@ -187,7 +187,7 @@ func (s *IssueService) createIssue(ctx context.Context, tx *sql.Tx, create *api.
return &issue, nil
}
-func (s *IssueService) findIssueList(ctx context.Context, tx *sql.Tx, find *api.IssueFind) (_ []*api.Issue, err error) {
+func (s *IssueService) findIssueList(ctx context.Context, tx *sql.Tx, find *api.IssueFind) ([]*api.Issue, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/issue_subscriber.go b/store/issue_subscriber.go
index c450f32fd9..4fa5bad4ff 100644
--- a/store/issue_subscriber.go
+++ b/store/issue_subscriber.go
@@ -112,7 +112,7 @@ func createIssueSubscriber(ctx context.Context, tx *sql.Tx, create *api.IssueSub
return &issueSubscriber, nil
}
-func findIssueSubscriberList(ctx context.Context, tx *sql.Tx, find *api.IssueSubscriberFind) (_ []*api.IssueSubscriber, err error) {
+func findIssueSubscriberList(ctx context.Context, tx *sql.Tx, find *api.IssueSubscriberFind) ([]*api.IssueSubscriber, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.IssueID; v != nil {
diff --git a/store/member.go b/store/member.go
index 3fb34f978a..97f86c7ff3 100644
--- a/store/member.go
+++ b/store/member.go
@@ -182,7 +182,7 @@ func createMember(ctx context.Context, tx *sql.Tx, create *api.MemberCreate) (*a
return &member, nil
}
-func findMemberList(ctx context.Context, tx *sql.Tx, find *api.MemberFind) (_ []*api.Member, err error) {
+func findMemberList(ctx context.Context, tx *sql.Tx, find *api.MemberFind) ([]*api.Member, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/pipeline.go b/store/pipeline.go
index 213f7c1aba..579ecac274 100644
--- a/store/pipeline.go
+++ b/store/pipeline.go
@@ -176,7 +176,7 @@ func (s *PipelineService) createPipeline(ctx context.Context, tx *sql.Tx, create
return &pipeline, nil
}
-func (s *PipelineService) findPipelineList(ctx context.Context, tx *sql.Tx, find *api.PipelineFind) (_ []*api.Pipeline, err error) {
+func (s *PipelineService) findPipelineList(ctx context.Context, tx *sql.Tx, find *api.PipelineFind) ([]*api.Pipeline, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/policy.go b/store/policy.go
index 0f7036d8bf..48a4b45f9b 100644
--- a/store/policy.go
+++ b/store/policy.go
@@ -73,7 +73,7 @@ func (s *PolicyService) FindPolicy(ctx context.Context, find *api.PolicyFind) (*
return ret, nil
}
-func (s *PolicyService) findPolicy(ctx context.Context, tx *sql.Tx, find *api.PolicyFind) (_ []*api.Policy, err error) {
+func (s *PolicyService) findPolicy(ctx context.Context, tx *sql.Tx, find *api.PolicyFind) ([]*api.Policy, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/principal.go b/store/principal.go
index b5ed7c9506..e74bb5c166 100644
--- a/store/principal.go
+++ b/store/principal.go
@@ -185,7 +185,7 @@ func createPrincipal(ctx context.Context, tx *sql.Tx, create *api.PrincipalCreat
return &principal, nil
}
-func findPrincipalList(ctx context.Context, tx *sql.Tx, find *api.PrincipalFind) (_ []*api.Principal, err error) {
+func findPrincipalList(ctx context.Context, tx *sql.Tx, find *api.PrincipalFind) ([]*api.Principal, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/project.go b/store/project.go
index 6d3f54270e..61d270cae9 100644
--- a/store/project.go
+++ b/store/project.go
@@ -211,7 +211,7 @@ func createProject(ctx context.Context, tx *sql.Tx, create *api.ProjectCreate) (
return &project, nil
}
-func findProjectList(ctx context.Context, tx *sql.Tx, find *api.ProjectFind) (_ []*api.ProjectRaw, err error) {
+func findProjectList(ctx context.Context, tx *sql.Tx, find *api.ProjectFind) ([]*api.ProjectRaw, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/project_member.go b/store/project_member.go
index ebf91843e1..adf0992574 100644
--- a/store/project_member.go
+++ b/store/project_member.go
@@ -293,7 +293,7 @@ func createProjectMember(ctx context.Context, tx *sql.Tx, create *api.ProjectMem
return &projectMember, nil
}
-func findProjectMemberList(ctx context.Context, tx *sql.Tx, find *api.ProjectMemberFind) (_ []*api.ProjectMember, err error) {
+func findProjectMemberList(ctx context.Context, tx *sql.Tx, find *api.ProjectMemberFind) ([]*api.ProjectMember, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/project_webhook.go b/store/project_webhook.go
index 24b32eefc5..110397f784 100644
--- a/store/project_webhook.go
+++ b/store/project_webhook.go
@@ -175,7 +175,7 @@ func createProjectWebhook(ctx context.Context, tx *sql.Tx, create *api.ProjectWe
return &projectWebhook, nil
}
-func findProjectWebhookList(ctx context.Context, tx *sql.Tx, find *api.ProjectWebhookFind) (_ []*api.ProjectWebhook, err error) {
+func findProjectWebhookList(ctx context.Context, tx *sql.Tx, find *api.ProjectWebhookFind) ([]*api.ProjectWebhook, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/repository.go b/store/repository.go
index 66d1844f01..f1d7688534 100644
--- a/store/repository.go
+++ b/store/repository.go
@@ -223,7 +223,7 @@ func (s *RepositoryService) createRepository(ctx context.Context, tx *sql.Tx, cr
return &repository, nil
}
-func findRepositoryList(ctx context.Context, tx *sql.Tx, find *api.RepositoryFind) (_ []*api.Repository, err error) {
+func findRepositoryList(ctx context.Context, tx *sql.Tx, find *api.RepositoryFind) ([]*api.Repository, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/setting.go b/store/setting.go
index ec606c44f4..656336655d 100644
--- a/store/setting.go
+++ b/store/setting.go
@@ -156,7 +156,7 @@ func createSetting(ctx context.Context, tx *sql.Tx, create *api.SettingCreate) (
return &setting, nil
}
-func findSettingList(ctx context.Context, tx *sql.Tx, find *api.SettingFind) (_ []*api.Setting, err error) {
+func findSettingList(ctx context.Context, tx *sql.Tx, find *api.SettingFind) ([]*api.Setting, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.Name; v != nil {
diff --git a/store/sheet.go b/store/sheet.go
index 098cda321c..a19b993214 100644
--- a/store/sheet.go
+++ b/store/sheet.go
@@ -237,7 +237,7 @@ func patchSheet(ctx context.Context, tx *sql.Tx, patch *api.SheetPatch) (*api.Sh
return nil, &common.Error{Code: common.NotFound, Err: fmt.Errorf("sheet ID not found: %d", patch.ID)}
}
-func findSheetList(ctx context.Context, tx *sql.Tx, find *api.SheetFind) (_ []*api.Sheet, err error) {
+func findSheetList(ctx context.Context, tx *sql.Tx, find *api.SheetFind) ([]*api.Sheet, error) {
where, args := []string{"1 = 1"}, []interface{}{}
// Standard fields
if v := find.ID; v != nil {
diff --git a/store/stage.go b/store/stage.go
index b101a643a4..34f0cf77a6 100644
--- a/store/stage.go
+++ b/store/stage.go
@@ -127,7 +127,7 @@ func (s *StageService) createStage(ctx context.Context, tx *sql.Tx, create *api.
return &stage, nil
}
-func (s *StageService) findStageList(ctx context.Context, tx *sql.Tx, find *api.StageFind) (_ []*api.Stage, err error) {
+func (s *StageService) findStageList(ctx context.Context, tx *sql.Tx, find *api.StageFind) ([]*api.Stage, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/table.go b/store/table.go
index 5d562a5e97..589b64144c 100644
--- a/store/table.go
+++ b/store/table.go
@@ -175,7 +175,7 @@ func (s *TableService) createTable(ctx context.Context, tx *sql.Tx, create *api.
return &table, nil
}
-func (s *TableService) findTableList(ctx context.Context, tx *sql.Tx, find *api.TableFind) (_ []*api.Table, err error) {
+func (s *TableService) findTableList(ctx context.Context, tx *sql.Tx, find *api.TableFind) ([]*api.Table, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/table_index.go b/store/table_index.go
index 84f1d70bc6..e7418d7093 100644
--- a/store/table_index.go
+++ b/store/table_index.go
@@ -146,7 +146,7 @@ func (s *IndexService) createIndex(ctx context.Context, tx *sql.Tx, create *api.
return &index, nil
}
-func (s *IndexService) findIndexList(ctx context.Context, tx *sql.Tx, find *api.IndexFind) (_ []*api.Index, err error) {
+func (s *IndexService) findIndexList(ctx context.Context, tx *sql.Tx, find *api.IndexFind) ([]*api.Index, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/task.go b/store/task.go
index d896d27774..5a204e1fe9 100644
--- a/store/task.go
+++ b/store/task.go
@@ -242,7 +242,7 @@ func (s *TaskService) findTask(ctx context.Context, tx *sql.Tx, find *api.TaskFi
return list[0], nil
}
-func (s *TaskService) findTaskList(ctx context.Context, tx *sql.Tx, find *api.TaskFind) (_ []*api.Task, err error) {
+func (s *TaskService) findTaskList(ctx context.Context, tx *sql.Tx, find *api.TaskFind) ([]*api.Task, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/task_check_run.go b/store/task_check_run.go
index 8a399015eb..59b28c8219 100644
--- a/store/task_check_run.go
+++ b/store/task_check_run.go
@@ -249,7 +249,7 @@ func (s *TaskCheckRunService) patchTaskCheckRunStatusTx(ctx context.Context, tx
return nil, &common.Error{Code: common.NotFound, Err: fmt.Errorf("task check run ID not found: %d", *patch.ID)}
}
-func (s *TaskCheckRunService) findTaskCheckRunList(ctx context.Context, tx *sql.Tx, find *api.TaskCheckRunFind) (_ []*api.TaskCheckRun, err error) {
+func (s *TaskCheckRunService) findTaskCheckRunList(ctx context.Context, tx *sql.Tx, find *api.TaskCheckRunFind) ([]*api.TaskCheckRun, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/task_run.go b/store/task_run.go
index 4eb2f90891..e17df46184 100644
--- a/store/task_run.go
+++ b/store/task_run.go
@@ -170,7 +170,7 @@ func (s *TaskRunService) PatchTaskRunStatusTx(ctx context.Context, tx *sql.Tx, p
return &taskRun, nil
}
-func (s *TaskRunService) findTaskRunList(ctx context.Context, tx *sql.Tx, find *api.TaskRunFind) (_ []*api.TaskRun, err error) {
+func (s *TaskRunService) findTaskRunList(ctx context.Context, tx *sql.Tx, find *api.TaskRunFind) ([]*api.TaskRun, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/vcs.go b/store/vcs.go
index 5dc5a6e335..9a5f24b206 100644
--- a/store/vcs.go
+++ b/store/vcs.go
@@ -177,7 +177,7 @@ func createVCS(ctx context.Context, tx *sql.Tx, create *api.VCSCreate) (*api.VCS
return &vcs, nil
}
-func findVCSList(ctx context.Context, tx *sql.Tx, find *api.VCSFind) (_ []*api.VCS, err error) {
+func findVCSList(ctx context.Context, tx *sql.Tx, find *api.VCSFind) ([]*api.VCS, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {
diff --git a/store/view.go b/store/view.go
index 2796905927..ef315fab30 100644
--- a/store/view.go
+++ b/store/view.go
@@ -154,7 +154,7 @@ func (s *ViewService) createView(ctx context.Context, tx *sql.Tx, create *api.Vi
return &view, nil
}
-func (s *ViewService) findViewList(ctx context.Context, tx *sql.Tx, find *api.ViewFind) (_ []*api.View, err error) {
+func (s *ViewService) findViewList(ctx context.Context, tx *sql.Tx, find *api.ViewFind) ([]*api.View, error) {
// Build WHERE clause.
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.ID; v != nil {