From b764917cd5c1b1d61b8ce08e7af0b29793fbbb80 Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Sat, 1 Oct 2016 21:14:18 -0700 Subject: lint fixes --- internal/tlog/log.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'internal/tlog/log.go') 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 -- cgit v1.2.3