Skip to content

Commit f5f8b15

Browse files
authored
Return not nil
1 parent 86ac8d6 commit f5f8b15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vmdb-api/repository.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (r *Repository) findConfigBy(ctx context.Context, key string) (*Config, err
2929
}
3030

3131
func (r *Repository) listProblemEnvironments(ctx context.Context) ([]ProblemEnvironment, error) {
32-
var result []ProblemEnvironment
32+
result := []ProblemEnvironment{}
3333
if err := r.db.NewSelect().Model(&result).Scan(ctx); err != nil {
3434
return nil, err
3535
}
@@ -81,7 +81,7 @@ func (r *Repository) findAnswerBy(ctx context.Context, answerID uuid.UUID) (*Ans
8181
}
8282

8383
func (r *Repository) listUnscoredAnswersFor(ctx context.Context, problemID uuid.UUID) ([]Answer, error) {
84-
var result []Answer
84+
result := []Answer{}
8585
err := r.db.NewSelect().ColumnExpr("answers.*").
8686
Table("answers").
8787
Join("INNER JOIN scores").JoinOn("answers.id = scores.answer_id").

0 commit comments

Comments
 (0)