comparison pkg/imports/dsec.go @ 5490:5f47eeea988d logging

Use own logging package.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 20 Sep 2021 17:45:39 +0200
parents 59a99655f34d
children 6270951dda28
comparison
equal deleted inserted replaced
5488:a726a92ea5c9 5490:5f47eeea988d
16 import ( 16 import (
17 "context" 17 "context"
18 "database/sql" 18 "database/sql"
19 "errors" 19 "errors"
20 "fmt" 20 "fmt"
21 "log" 21
22 "gemma.intevation.de/gemma/pkg/log"
22 ) 23 )
23 24
24 // DeleteSection is a Job to delete a section from the database. 25 // DeleteSection is a Job to delete a section from the database.
25 type DeleteSection struct { 26 type DeleteSection struct {
26 ID int64 `json:"id"` 27 ID int64 `json:"id"`
69 if err != nil { 70 if err != nil {
70 return err 71 return err
71 } 72 }
72 n, err := res.RowsAffected() 73 n, err := res.RowsAffected()
73 if err != nil { 74 if err != nil {
74 log.Println( 75 log.Errorf(
75 "error: RowsAffected returned an error. Missing driver support?") 76 "RowsAffected returned an error. Missing driver support?")
76 return nil 77 return nil
77 } 78 }
78 if n == 0 { 79 if n == 0 {
79 return errors.New( 80 return errors.New(
80 "nothing deleted. Probably due to missing access rights") 81 "nothing deleted. Probably due to missing access rights")