Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Quit without error on Ctrl^D
Browse files Browse the repository at this point in the history
  • Loading branch information
Soulou authored and alfredxing committed Feb 16, 2015
1 parent 530f499 commit 9a3700b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"io"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -38,6 +39,10 @@ func main() {
for {
text, err := term.ReadLine()
if err != nil {
if err == io.EOF {
// Quit without error on Ctrl^D
break
}
panic(err)
}

Expand Down

0 comments on commit 9a3700b

Please sign in to comment.