Skip to content

Commit 4793886

Browse files
authored
Merge pull request #43 from thaJeztah/deprecate_ErrInvalidState
deprecate ErrInvalidState
2 parents 2ff7073 + fddc34e commit 4793886

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

term.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
)
1515

1616
// ErrInvalidState is returned if the state of the terminal is invalid.
17+
//
18+
// Deprecated: ErrInvalidState is no longer used.
1719
var ErrInvalidState = errors.New("Invalid terminal state")
1820

1921
// State represents the state of the terminal.
@@ -55,7 +57,7 @@ func IsTerminal(fd uintptr) bool {
5557
// to a previous state.
5658
func RestoreTerminal(fd uintptr, state *State) error {
5759
if state == nil {
58-
return ErrInvalidState
60+
return errors.New("invalid terminal state")
5961
}
6062
return tcset(fd, &state.termios)
6163
}

0 commit comments

Comments
 (0)