Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func lexVariables(l *lexer) stateFn {
}
}

func lexTop(l *lexer) stateFn {
func lexTop(*lexer) stateFn {
return lexVariables
}

Expand Down
8 changes: 4 additions & 4 deletions conf/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ var parseTests = []struct {
Blocks: []Block{
{
Include: []string{"foo"},
Preps: []Prep{Prep{Command: "command"}},
Preps: []Prep{{Command: "command"}},
},
},
},
Expand All @@ -171,7 +171,7 @@ var parseTests = []struct {
Blocks: []Block{
{
Include: []string{"foo"},
Preps: []Prep{Prep{Command: "command", Onchange: true}},
Preps: []Prep{{Command: "command", Onchange: true}},
},
},
},
Expand All @@ -183,7 +183,7 @@ var parseTests = []struct {
Blocks: []Block{
{
Include: []string{"foo"},
Preps: []Prep{Prep{Command: "command\n-one\n-two"}},
Preps: []Prep{{Command: "command\n-one\n-two"}},
},
},
},
Expand All @@ -195,7 +195,7 @@ var parseTests = []struct {
Blocks: []Block{
{
Include: []string{"foo", "bar"},
Preps: []Prep{Prep{Command: "command"}},
Preps: []Prep{{Command: "command"}},
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (d *daemon) Restart() {
}
}

func (d *daemon) Shutdown(sig os.Signal) error {
func (d *daemon) Shutdown() error {
d.log.Notice(">> stopping")
d.stop = true
if d.ex != nil {
Expand Down Expand Up @@ -160,7 +160,7 @@ func (dp *DaemonPen) Shutdown(sig os.Signal) {
defer dp.Unlock()
if dp.daemons != nil {
for _, d := range dp.daemons {
d.Shutdown(sig)
d.Shutdown()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions notify/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type GrowlNotifier struct {
}

// Push implements Notifier
func (GrowlNotifier) Push(title string, text string, iconPath string) {
func (GrowlNotifier) Push(_ string, text string, _ string) {
cmd := exec.Command(
"growlnotify", "-n", prog, "-d", prog, "-m", text, prog,
)
Expand All @@ -45,7 +45,7 @@ type LibnotifyNotifier struct {
}

// Push implements Notifier
func (LibnotifyNotifier) Push(title string, text string, iconPath string) {
func (LibnotifyNotifier) Push(_ string, text string, _ string) {
cmd := exec.Command(
"notify-send", prog, text,
)
Expand Down
15 changes: 0 additions & 15 deletions proc.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package modd

import (
"bufio"
"io"
"strings"
"sync"

"github.com/cortesi/termlog"
)
Expand Down Expand Up @@ -33,15 +30,3 @@ func niceHeader(preamble string, command string) string {
command = termlog.DefaultPalette.Header.SprintFunc()(shortCommand(command))
return pre + command
}

func logOutput(wg *sync.WaitGroup, fp io.ReadCloser, out func(string, ...interface{})) {
defer wg.Done()
r := bufio.NewReader(fp)
for {
line, _, err := r.ReadLine()
if err != nil {
return
}
out("%s", string(line))
}
}
4 changes: 2 additions & 2 deletions shell/proc_windows.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//go:build windows
// +build windows

package shell

import (
"os"
"os/exec"
"strconv"
"syscall"
Expand All @@ -16,6 +16,6 @@ func prepCmd(cmd *exec.Cmd) {
}
}

func (e *Executor) sendSignal(sig os.Signal) error {
func (e *Executor) sendSignal() error {
return exec.Command("taskkill", "/f", "/t", "/pid", strconv.Itoa(e.cmd.Process.Pid)).Run()
}
2 changes: 1 addition & 1 deletion shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (e *Executor) Signal(sig os.Signal) error {
if !e.running() {
return fmt.Errorf("executor not running")
}
return e.sendSignal(sig)
return e.sendSignal()
}

func (e *Executor) Stop() error {
Expand Down