From 5678759cef399bcb4780626f876bf62713a87c2b Mon Sep 17 00:00:00 2001 From: alessio Date: Sat, 1 Apr 2017 20:50:06 +0200 Subject: [PATCH] lint --- settings/settings.go | 2 +- settings/utils.go | 10 ++++++---- watcher/main.go | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/settings/settings.go b/settings/settings.go index d8162fb..733b974 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -21,7 +21,7 @@ type Config struct { Legacy `yaml:"legacy,omitempty" json:"legacy,omitempty"` } -// Polling configuration +// Legacy configuration type Legacy struct { Status bool `yaml:"status" json:"status"` Interval time.Duration `yaml:"interval" json:"interval"` diff --git a/settings/utils.go b/settings/utils.go index 327f87c..f1af11d 100644 --- a/settings/utils.go +++ b/settings/utils.go @@ -31,15 +31,17 @@ func (s Settings) Fatal(err error, msg ...interface{}) { } } -func (h Settings) Name(name string, path string) string { +// Name return the project name or the path of the working dir +func (s Settings) Name(name string, path string) string { if name == "" && path == "" { - return h.Wdir() + return s.Wdir() } else if path != "/" { return filepath.Base(path) } return name } -func (h Settings) Path(s string) string { - return strings.Replace(filepath.Clean(s), "\\", "/", -1) +// Path cleaner +func (s Settings) Path(path string) string { + return strings.Replace(filepath.Clean(path), "\\", "/", -1) } diff --git a/watcher/main.go b/watcher/main.go index c3a6f80..ba5c367 100644 --- a/watcher/main.go +++ b/watcher/main.go @@ -68,7 +68,7 @@ type Command struct { Path string `yaml:"path" json:"path"` } -// File determinates the status of each log files (streams, logs, errors) +// Streams is a collection of names and values for the logs functionality type Streams struct { CliOut bool `yaml:"cli_out" json:"cli_out"` FileOut bool `yaml:"file_out" json:"file_out"`