This commit is contained in:
asoseil 2017-10-17 11:56:19 +02:00
parent db722a9e98
commit cb817b10c5
4 changed files with 7 additions and 13 deletions

4
cmd.go
View File

@ -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"`

View File

@ -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 {

View File

@ -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,
},

View File

@ -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