diff --git a/cmd/icinga-kubernetes/main.go b/cmd/icinga-kubernetes/main.go index d9e2cd8..3c590e6 100644 --- a/cmd/icinga-kubernetes/main.go +++ b/cmd/icinga-kubernetes/main.go @@ -3,6 +3,7 @@ package main import ( "context" "flag" + "fmt" _ "github.com/go-sql-driver/mysql" "github.com/google/uuid" "github.com/icinga/icinga-go-library/backoff" @@ -154,7 +155,9 @@ func main() { if err != nil { klog.Fatal(err) } - defer rows.Close() + defer func() { + _ = rows.Close() + }() dbLog.Info("Dropping schema") @@ -164,7 +167,7 @@ func main() { klog.Fatal(err) } - _, err := kdb.Exec("DROP TABLE " + tableName) + _, err := kdb.Exec(fmt.Sprintf(`DROP TABLE %s`, tableName)) if err != nil { klog.Fatal(err) }