Skip to content
Myr

Code cleanup: Remove unused argument

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 208e556 · Browse files · 2 files+6 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−10 removed

  • other:+6 added−10 removed

2 files+6 added−10 removed

modified:src/reader_test.go+2 added-2 removed
20 unmodified lines
21 t.Error("EvtReadNew should not be set yet")22 }2324 // Normal command25 reader.fin(reader.readFromCommand(nil, `echo abc&&echo def`))25 reader.fin(reader.readFromCommand(`echo abc&&echo def`))26 if len(strs) != 2 || strs[0] != "abc" || strs[1] != "def" {27 t.Errorf("%s", strs)28 }29
16 unmodified lines
46 // Restart event poller47 reader.startEventPoller()4849 // Failing command50 reader.fin(reader.readFromCommand(nil, `no-such-command`))50 reader.fin(reader.readFromCommand(`no-such-command`))51 strs = []string{}52 if len(strs) > 0 {53 t.Errorf("%s", strs)54 }
9 unmodified lines
modified:src/reader.go+4 added-8 removed
86 unmodified lines
8788func (r *Reader) restart(command string) {89 r.event = int32(EvtReady)90 r.startEventPoller()91 success := r.readFromCommand(nil, command)91 success := r.readFromCommand(command)92 r.fin(success)93}9495// ReadSource reads data from the default command or from standard input
4 unmodified lines
100 cmd := os.Getenv("FZF_DEFAULT_COMMAND")101 if len(cmd) == 0 {102 success = r.readFiles()103 } else {104 success = r.readFromCommand(nil, cmd)104 success = r.readFromCommand(cmd)105 }106 } else {107 success = r.readFromStdin()108 }
61 unmodified lines
170 }171 return fastwalk.Walk(&conf, ".", fn) == nil172}173174func (r *Reader) readFromCommand(shell *string, command string) bool {174func (r *Reader) readFromCommand(command string) bool {175 r.mutex.Lock()176 r.killed = false177 r.command = &command178 if shell != nil {179 r.exec = util.ExecCommandWith(*shell, command, true)180 } else {181 r.exec = util.ExecCommand(command, true)178 r.exec = util.ExecCommand(command, true)182 }179 out, err := r.exec.StdoutPipe()180 if err != nil {181 r.mutex.Unlock()182 return false
9 unmodified lines