From 599ac11f26cb57cda1d0c5ce6d05c382f469acac Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Tue, 26 Feb 2019 21:27:04 +0300 Subject: [PATCH] cleanup --- client.go | 2 +- eval.go | 10 +++++----- main.go | 2 +- nav.go | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client.go b/client.go index b63cc2b1..f6bc47fc 100644 --- a/client.go +++ b/client.go @@ -140,7 +140,7 @@ func loadFiles() (list []string, cp bool, err error) { return } -func sendRemote(cmd string) error { +func remote(cmd string) error { c, err := net.Dial(gSocketProt, gSocketPath) if err != nil { return fmt.Errorf("dialing to send server: %s", err) diff --git a/eval.go b/eval.go index 3a70a9cc..93af84fd 100644 --- a/eval.go +++ b/eval.go @@ -443,7 +443,7 @@ func insert(app *app, arg string) { return } app.nav.unselect() - if err := sendRemote("send load"); err != nil { + if err := remote("send load"); err != nil { app.ui.printf("delete: %s", err) } } @@ -597,7 +597,7 @@ func (e *callExpr) eval(app *app, args []string) { return } app.nav.unselect() - if err := sendRemote("send sync"); err != nil { + if err := remote("send sync"); err != nil { app.ui.printf("copy: %s", err) } case "cut": @@ -606,7 +606,7 @@ func (e *callExpr) eval(app *app, args []string) { return } app.nav.unselect() - if err := sendRemote("send sync"); err != nil { + if err := remote("send sync"); err != nil { app.ui.printf("cut: %s", err) } case "paste": @@ -620,7 +620,7 @@ func (e *callExpr) eval(app *app, args []string) { if cmd, ok := gOpts.cmds["delete"]; ok { cmd.eval(app, e.args) app.nav.unselect() - if err := sendRemote("send load"); err != nil { + if err := remote("send load"); err != nil { app.ui.printf("delete: %s", err) } } else { @@ -635,7 +635,7 @@ func (e *callExpr) eval(app *app, args []string) { app.ui.printf("clear: %s", err) return } - if err := sendRemote("send sync"); err != nil { + if err := remote("send sync"); err != nil { app.ui.printf("clear: %s", err) } case "draw": diff --git a/main.go b/main.go index 2f49c7fc..a2298f4b 100644 --- a/main.go +++ b/main.go @@ -132,7 +132,7 @@ func main() { case *showVersion: fmt.Println(gVersion) case *remoteCmd != "": - if err := sendRemote(*remoteCmd); err != nil { + if err := remote(*remoteCmd); err != nil { log.Fatalf("remote command: %s", err) } case *serverMode: diff --git a/nav.go b/nav.go index 645c6377..0828130b 100644 --- a/nav.go +++ b/nav.go @@ -612,7 +612,7 @@ loop: } } - if err := sendRemote("send load"); err != nil { + if err := remote("send load"); err != nil { errCount++ echo.args[0] = fmt.Sprintf("[%d] error: %s", errCount, err) ui.exprChan <- echo @@ -663,7 +663,7 @@ func moveAsync(ui *ui, srcs []string, dstDir string) { } } - if err := sendRemote("send load"); err != nil { + if err := remote("send load"); err != nil { errCount++ echo.args[0] = fmt.Sprintf("[%d] error: %s", errCount, err) ui.exprChan <- echo @@ -692,7 +692,7 @@ func (nav *nav) paste(ui *ui) error { return fmt.Errorf("clearing copy/cut buffer: %s", err) } - if err := sendRemote("send sync"); err != nil { + if err := remote("send sync"); err != nil { return fmt.Errorf("paste: %s", err) }