From cb817b10c580a0f35b13bcee8408e1d8536597d3 Mon Sep 17 00:00:00 2001 From: asoseil Date: Tue, 17 Oct 2017 11:56:19 +0200 Subject: [PATCH] lint --- cmd.go | 4 ++-- notify.go | 6 +++--- realize.go | 5 +---- settings.go | 5 +---- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/cmd.go b/cmd.go index e876627..774263e 100644 --- a/cmd.go +++ b/cmd.go @@ -18,7 +18,7 @@ type tool struct { options []string } -// Cmds +// Cmds list of go commands type Cmds struct { Vet Cmd `yaml:"vet,omitempty" json:"vet,omitempty"` Fmt Cmd `yaml:"fmt,omitempty" json:"fmt,omitempty"` @@ -29,7 +29,7 @@ type Cmds struct { Run bool `yaml:"run,omitempty" json:"run,omitempty"` } -// Cmd +// Cmd single command fields and options type Cmd struct { Status bool `yaml:"status,omitempty" json:"status,omitempty"` Method string `yaml:"method,omitempty" json:"method,omitempty"` diff --git a/notify.go b/notify.go index d52cbfa..19eac5a 100644 --- a/notify.go +++ b/notify.go @@ -54,7 +54,7 @@ type ( } ) -// NewPollingWatcher returns a poll-based file watcher +// PollingWatcher returns a poll-based file watcher func PollingWatcher(interval time.Duration) FileWatcher { if interval == 0 { interval = 100 * time.Millisecond @@ -66,7 +66,7 @@ func PollingWatcher(interval time.Duration) FileWatcher { } } -// New tries to use an fs-event watcher, and falls back to the poller if there is an error +// Watcher tries to use an fs-event watcher, and falls back to the poller if there is an error func Watcher(force bool, interval time.Duration) (FileWatcher, error) { if !force { if w, err := EventWatcher(); err == nil { @@ -76,7 +76,7 @@ func Watcher(force bool, interval time.Duration) (FileWatcher, error) { return PollingWatcher(interval), nil } -// NewEventWatcher returns an fs-event based file watcher +// EventWatcher returns an fs-event based file watcher func EventWatcher() (FileWatcher, error) { w, err := fsnotify.NewWatcher() if err != nil { diff --git a/realize.go b/realize.go index 6a9cc8b..4bd957f 100644 --- a/realize.go +++ b/realize.go @@ -76,10 +76,7 @@ func main() { if err := r.Server.start(p); err != nil { return err } - if err := r.run(p); err != nil { - return err - } - return nil + return r.run(p) }, Before: before, }, diff --git a/settings.go b/settings.go index 2e6f889..5820549 100644 --- a/settings.go +++ b/settings.go @@ -90,10 +90,7 @@ func (s *Settings) flimit() error { rLimit.Max = uint64(s.FileLimit) rLimit.Cur = uint64(s.FileLimit) - if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit); err != nil { - return err - } - return nil + return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit) } // Delete realize folder