From e43af6b493f25426a204179288a064ff180c438f Mon Sep 17 00:00:00 2001 From: Denis Gukov Date: Fri, 22 Nov 2024 17:14:16 +0500 Subject: [PATCH] fix(runner): return empty array instead of null for boltdb --- db/bolt/runner.go | 3 +++ db/sql/runner.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/db/bolt/runner.go b/db/bolt/runner.go index d93801d2..4d5416e7 100644 --- a/db/bolt/runner.go +++ b/db/bolt/runner.go @@ -7,13 +7,16 @@ import ( ) func (d *BoltDb) GetRunner(projectID int, runnerID int) (runner db.Runner, err error) { + err = db.ErrNotFound return } func (d *BoltDb) GetRunners(projectID int, activeOnly bool) (runners []db.Runner, err error) { + runners = make([]db.Runner, 0) return } func (d *BoltDb) DeleteRunner(projectID int, runnerID int) (err error) { + err = db.ErrNotFound return } diff --git a/db/sql/runner.go b/db/sql/runner.go index 0643058b..f3ed4028 100644 --- a/db/sql/runner.go +++ b/db/sql/runner.go @@ -7,6 +7,7 @@ import ( ) func (d *SqlDb) GetRunner(projectID int, runnerID int) (runner db.Runner, err error) { + err = db.ErrNotFound return } @@ -16,5 +17,6 @@ func (d *SqlDb) GetRunners(projectID int, activeOnly bool) (runners []db.Runner, } func (d *SqlDb) DeleteRunner(projectID int, runnerID int) (err error) { + err = db.ErrNotFound return }