lint
This commit is contained in:
parent
db722a9e98
commit
cb817b10c5
4
cmd.go
4
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"`
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue