Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
michael.kochegarov authored and michael.kochegarov committed Jun 5, 2018
1 parent b4c07e9 commit 55b938b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ Use the `go` command:
import (
"fmt"
"os"
"syscall"

input "github.com/NexoMichael/inputreader"
)

func main() {
reader, _ := input.NewInputReader(os.Stdin)
defer reader.Close()
defer func() {
reader.Close()
}()

var b [1]byte
for {
Expand All @@ -46,6 +49,11 @@ Use the `go` command:
}

fmt.Printf(" - code is %d\n\r", b[0])

switch syscall.Signal(b[0]) {
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
return
}
}
}

Expand Down

0 comments on commit 55b938b

Please sign in to comment.