From f4f6d13df966e4673fab2bab5429ae30c1b40179 Mon Sep 17 00:00:00 2001 From: ferhat elmas Date: Sat, 13 Apr 2019 17:40:06 +0200 Subject: [PATCH] batch: drop unpossible error check in favor of annotated error message. There is also unrelated diff due to gofmt. --- store/batch/batch.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/store/batch/batch.go b/store/batch/batch.go index 65b92519..5c93e0af 100644 --- a/store/batch/batch.go +++ b/store/batch/batch.go @@ -77,10 +77,7 @@ func (b *batchUpdater) Batch(ctx context.Context, user *core.User, batch *core.B } _, err = execer.Exec(stmt, args...) if err != nil { - return err - } - if err != nil { - return fmt.Errorf("Error inserting repositroy: %s", err) + return fmt.Errorf("Error inserting repository: %s", err) } // @@ -120,10 +117,7 @@ func (b *batchUpdater) Batch(ctx context.Context, user *core.User, batch *core.B } _, err = execer.Exec(stmt, args...) if err != nil { - return err - } - if err != nil { - return fmt.Errorf("Error updating repositroy: %s", err) + return fmt.Errorf("Error updating repository: %s", err) } stmt = permInsertIgnoreStmt @@ -235,7 +229,7 @@ const repoInsertIgnoreStmtPostgres = ` INSERT INTO repos ` + stmtInsertBase + ` ON CONFLICT DO NOTHING` const repoUpdateRemoteStmt = ` -UPDATE repos SET +UPDATE repos SET repo_namespace=:repo_namespace ,repo_name=:repo_name ,repo_slug=:repo_slug @@ -249,7 +243,7 @@ WHERE repo_id=:repo_id ` const repoUpdateRemoteStmtPostgres = ` -UPDATE repos SET +UPDATE repos SET repo_namespace=$1 ,repo_name=$2 ,repo_slug=$3