From bf47405209a2c106aa841ae83911d92b5ffabb8b Mon Sep 17 00:00:00 2001 From: Thomas Menard Date: Thu, 11 Feb 2016 10:24:27 +0100 Subject: [PATCH] ran go fmt as requested --- plugins/inputs/postgresql/postgresql.go | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/plugins/inputs/postgresql/postgresql.go b/plugins/inputs/postgresql/postgresql.go index 6e1b3cceb..810fbf848 100644 --- a/plugins/inputs/postgresql/postgresql.go +++ b/plugins/inputs/postgresql/postgresql.go @@ -95,27 +95,27 @@ func (p *Postgresql) Gather(acc telegraf.Accumulator) error { } } //return rows.Err() - query = `SELECT * FROM pg_stat_bgwriter` + query = `SELECT * FROM pg_stat_bgwriter` - bg_writer_row, err := db.Query(query) - if err != nil { - return err - } + bg_writer_row, err := db.Query(query) + if err != nil { + return err + } - defer bg_writer_row.Close() + defer bg_writer_row.Close() - // grab the column information from the result - p.OrderedColumns, err = bg_writer_row.Columns() - if err != nil { - return err - } + // grab the column information from the result + p.OrderedColumns, err = bg_writer_row.Columns() + if err != nil { + return err + } - for bg_writer_row.Next() { - err = p.accRow(bg_writer_row, acc) - if err != nil { - return err - } - } + for bg_writer_row.Next() { + err = p.accRow(bg_writer_row, acc) + if err != nil { + return err + } + } return bg_writer_row.Err() } @@ -145,7 +145,7 @@ func (p *Postgresql) accRow(row scanner, acc telegraf.Accumulator) error { if err != nil { return err } - if columnMap["datname"] != nil { + if columnMap["datname"] != nil { // extract the database name from the column map dbnameChars := (*columnMap["datname"]).([]uint8) for i := 0; i < len(dbnameChars); i++ {