Skip to content

Commit 62a26d6

Browse files
Print conf only if debug is enabled
Co-authored-by: prabhu43 <j.prabhu91@gmail.com>
1 parent 41af389 commit 62a26d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type PGConfig struct {
2121
DBName string
2222
Query string
2323
FrequencyInMS int32
24+
Debug bool
2425
}
2526

2627
// ConnStr returns a connection string to connect to postgres
@@ -53,7 +54,9 @@ func main() {
5354
log.Fatal(err)
5455
}
5556

56-
json.NewEncoder(os.Stdout).Encode(conf)
57+
if conf.Debug {
58+
json.NewEncoder(os.Stdout).Encode(conf)
59+
}
5760

5861
db, err := sql.Open("postgres", conf.ConnStr())
5962
if err != nil {

0 commit comments

Comments
 (0)