diff options
author | Valient Gough | 2016-10-01 21:14:18 -0700 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-10-04 23:18:33 +0200 |
commit | b764917cd5c1b1d61b8ce08e7af0b29793fbbb80 (patch) | |
tree | 22222f3f245d43c1c534a38d7d57b900f50d0e08 /internal/tlog/log.go | |
parent | 31a8f8b83973867a50ac08106effb1bba3fdcb2d (diff) |
lint fixes
Diffstat (limited to 'internal/tlog/log.go')
-rw-r--r-- | internal/tlog/log.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/internal/tlog/log.go b/internal/tlog/log.go index a770df8..8db3de2 100644 --- a/internal/tlog/log.go +++ b/internal/tlog/log.go @@ -12,21 +12,34 @@ import ( ) const ( + // ProgramName is used in log reports. ProgramName = "gocryptfs" wpanicMsg = "-wpanic turns this warning into a panic: " ) // Escape sequences for terminal colors. These will be empty strings if stdout // is not a terminal. -var ColorReset, ColorGrey, ColorRed, ColorGreen, ColorYellow string +var ( + // ColorReset is used to reset terminal colors. + ColorReset string + // ColorGrey is a terminal color setting string. + ColorGrey string + // ColorRed is a terminal color setting string. + ColorRed string + // ColorGreen is a terminal color setting string. + ColorGreen string + // ColorYellow is a terminal color setting string. + ColorYellow string +) +// JSONDump writes the object in json form. func JSONDump(obj interface{}) string { b, err := json.MarshalIndent(obj, "", "\t") if err != nil { return err.Error() - } else { - return string(b) } + + return string(b) } // toggledLogger - a Logger than can be enabled and disabled |