Skip to content

Commit

Permalink
also close buffer file
Browse files Browse the repository at this point in the history
  • Loading branch information
Min-Jun Park committed Nov 12, 2015
1 parent f6e1b4d commit b6b347c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gexpect.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ package gexpect
import (
"bytes"
"errors"
shell "github.com/kballard/go-shellquote"
"github.com/kr/pty"
"io"
"os"
"os/exec"
"regexp"
"time"
"unicode/utf8"

shell "github.com/kballard/go-shellquote"
"github.com/kr/pty"
)

type ExpectSubprocess struct {
Expand Down Expand Up @@ -141,6 +142,7 @@ func Spawn(command string) (*ExpectSubprocess, error) {
}

func (expect *ExpectSubprocess) Close() error {
expect.buf.f.Close()
return expect.Cmd.Process.Kill()
}

Expand Down

0 comments on commit b6b347c

Please sign in to comment.