summaryrefslogtreecommitdiff
path: root/internal/tlog
diff options
context:
space:
mode:
authorValient Gough2016-10-01 21:14:18 -0700
committerJakob Unterwurzacher2016-10-04 23:18:33 +0200
commitb764917cd5c1b1d61b8ce08e7af0b29793fbbb80 (patch)
tree22222f3f245d43c1c534a38d7d57b900f50d0e08 /internal/tlog
parent31a8f8b83973867a50ac08106effb1bba3fdcb2d (diff)
lint fixes
Diffstat (limited to 'internal/tlog')
-rw-r--r--internal/tlog/log.go19
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