refactor: type check style
This commit is contained in:
+2
-2
@@ -11,6 +11,8 @@ import (
|
||||
opty "github.com/creack/pty"
|
||||
)
|
||||
|
||||
var _ IPty = (*Pty)(nil)
|
||||
|
||||
var defaultShells = []string{"zsh", "fish", "bash", "sh"}
|
||||
|
||||
type Pty struct {
|
||||
@@ -79,5 +81,3 @@ func (pty *Pty) Close() error {
|
||||
}
|
||||
return pty.killChildProcess(pty.cmd)
|
||||
}
|
||||
|
||||
var _ IPty = &Pty{}
|
||||
|
||||
@@ -19,6 +19,9 @@ import (
|
||||
"github.com/shirou/gopsutil/v4/host"
|
||||
)
|
||||
|
||||
var _ IPty = (*winPTY)(nil)
|
||||
var _ IPty = (*conPty)(nil)
|
||||
|
||||
var isWin10 = VersionCheck()
|
||||
|
||||
type winPTY struct {
|
||||
@@ -164,6 +167,3 @@ func (c *conPty) Close() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var _ IPty = &winPTY{}
|
||||
var _ IPty = &conPty{}
|
||||
|
||||
@@ -10,6 +10,8 @@ import (
|
||||
"github.com/UserExistsError/conpty"
|
||||
)
|
||||
|
||||
var _ IPty = (*Pty)(nil)
|
||||
|
||||
type Pty struct {
|
||||
tty *conpty.ConPty
|
||||
}
|
||||
@@ -61,5 +63,3 @@ func (pty *Pty) Close() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var _ IPty = &Pty{}
|
||||
|
||||
Reference in New Issue
Block a user