From e78499551ee94fff5ba13ce2b67fa0b9b50b5bd1 Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Mon, 13 Oct 2014 18:47:16 -0500 Subject: [PATCH] Disable Gin default debug mode, add -d flag to control it --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 2a30fa1..3b5c635 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( ) var options struct { + Debug bool `short:"d" description:"Enable debugging mode" default:"false"` Url string `long:"url" description:"Database connection string"` Host string `long:"host" description:"Server hostname or IP" default:"localhost"` Port int `long:"port" description:"Server port" default:"5432"` @@ -75,6 +76,10 @@ func main() { defer dbClient.db.Close() + if !options.Debug { + gin.SetMode("release") + } + router := gin.Default() router.GET("/", API_Home)