ran go fmt as requested

This commit is contained in:
Thomas Menard 2016-02-11 10:24:27 +01:00
parent eac52f1929
commit bf47405209
1 changed files with 18 additions and 18 deletions

View File

@ -95,27 +95,27 @@ func (p *Postgresql) Gather(acc telegraf.Accumulator) error {
} }
} }
//return rows.Err() //return rows.Err()
query = `SELECT * FROM pg_stat_bgwriter` query = `SELECT * FROM pg_stat_bgwriter`
bg_writer_row, err := db.Query(query) bg_writer_row, err := db.Query(query)
if err != nil { if err != nil {
return err return err
} }
defer bg_writer_row.Close() defer bg_writer_row.Close()
// grab the column information from the result // grab the column information from the result
p.OrderedColumns, err = bg_writer_row.Columns() p.OrderedColumns, err = bg_writer_row.Columns()
if err != nil { if err != nil {
return err return err
} }
for bg_writer_row.Next() { for bg_writer_row.Next() {
err = p.accRow(bg_writer_row, acc) err = p.accRow(bg_writer_row, acc)
if err != nil { if err != nil {
return err return err
} }
} }
return bg_writer_row.Err() return bg_writer_row.Err()
} }
@ -145,7 +145,7 @@ func (p *Postgresql) accRow(row scanner, acc telegraf.Accumulator) error {
if err != nil { if err != nil {
return err return err
} }
if columnMap["datname"] != nil { if columnMap["datname"] != nil {
// extract the database name from the column map // extract the database name from the column map
dbnameChars := (*columnMap["datname"]).([]uint8) dbnameChars := (*columnMap["datname"]).([]uint8)
for i := 0; i < len(dbnameChars); i++ { for i := 0; i < len(dbnameChars); i++ {