Skip to content

Commit

Permalink
Fixed some warnings from goreportcard:
Browse files Browse the repository at this point in the history
* Line 485: warning: ineffectual assignment to err (ineffassign)
* Line 564: warning: ineffectual assignment to err (ineffassign)
* Line 603: warning: ineffectual assignment to err (ineffassign)
  • Loading branch information
skx committed Jul 26, 2018
1 parent 6290e08 commit ba2647f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ func getReports(fqdn string) ([]PuppetReportSummary, error) {
// Select the status.
//
stmt, err := db.Prepare("SELECT id, fqdn, state, executed_at, runtime, failed, changed, total, yaml_file FROM reports WHERE fqdn=? ORDER by executed_at DESC LIMIT 50")
if err != nil {
return nil, err
}
rows, err := stmt.Query(fqdn)
if err != nil {
return nil, err
Expand Down Expand Up @@ -562,6 +565,10 @@ func getHistory() ([]PuppetHistory, error) {
// Get all the distinct dates we have data for.
//
stmt, err := db.Prepare("SELECT DISTINCT(strftime('%d/%m/%Y', DATE(executed_at, 'unixepoch'))) FROM reports")
if err != nil {
return nil, err
}

rows, err := stmt.Query()
if err != nil {
return nil, err
Expand Down Expand Up @@ -601,6 +608,10 @@ func getHistory() ([]PuppetHistory, error) {
x.Date = known

stmt, err = db.Prepare("SELECT distinct state, COUNT(state) AS CountOf FROM reports WHERE strftime('%d/%m/%Y', DATE(executed_at, 'unixepoch'))=? GROUP by state")
if err != nil {
return nil, err
}

rows, err = stmt.Query(known)
if err != nil {
return nil, err
Expand Down

0 comments on commit ba2647f

Please sign in to comment.