diff options
| author | Shulhan <ms@kilabit.info> | 2018-11-30 12:03:50 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-11-30 12:03:50 +0700 |
| commit | 3d9c2dd6541c076ae6bc09ab1db227521864b0d3 (patch) | |
| tree | 45de62474bccc567f0f559cc3735d0c3797e79b0 /lib/debug/debug.go | |
| parent | b73bf53f451bb71d59c6e502f92f5492659b2d00 (diff) | |
| download | pakakeh.go-3d9c2dd6541c076ae6bc09ab1db227521864b0d3.tar.xz | |
all: minimize and suppress linter warnings for global variables
Diffstat (limited to 'lib/debug/debug.go')
| -rw-r--r-- | lib/debug/debug.go | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/debug/debug.go b/lib/debug/debug.go index 00105ed2..cef71b26 100644 --- a/lib/debug/debug.go +++ b/lib/debug/debug.go @@ -9,24 +9,18 @@ package debug import ( "os" "strconv" - "sync" ) -var ( +var ( // nolint: gochecknoglobals // Value contains DEBUG value from environment. Value = 0 - once sync.Once ) -func loadEnvironment() { +// +// init initialize debug from system environment. +func init() { // nolint v := os.Getenv("DEBUG") if len(v) > 0 { Value, _ = strconv.Atoi(v) } } - -// -// init initialize debug from system environment. -func init() { // nolint - once.Do(loadEnvironment) -} |
