From 23d2d9109f060978705f3c7a8d2f8691b6f9107f Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 29 Jan 2018 20:54:38 -0800 Subject: Add the possiblity to enable debug mode with an environment variable --- config/config.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config') diff --git a/config/config.go b/config/config.go index 4f182e5..bf4f43d 100644 --- a/config/config.go +++ b/config/config.go @@ -48,6 +48,11 @@ func (c *Config) getInt(key string, fallback int) int { return v } +// HasDebugMode returns true if debug mode is enabled. +func (c *Config) HasDebugMode() bool { + return c.get("DEBUG", "") != "" +} + // BaseURL returns the application base URL. func (c *Config) BaseURL() string { return c.get("BASE_URL", defaultBaseURL) -- cgit v1.2.3