modularize monitor, reduce init usage (#81)
* kill process tree using syscall on windows & cleanup (#80) * kill process tree using syscall on windows & cleanup * use job api * add error check for cmd.Start * modularize monitor, reduce init usage * replace slices with sort * update gopsutil & other dependencies
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package pty
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
"github.com/shirou/gopsutil/v4/host"
|
||||
)
|
||||
|
||||
var isWin10 bool
|
||||
var isWin10 = VersionCheck()
|
||||
|
||||
type winPTY struct {
|
||||
tty *winpty.WinPTY
|
||||
@@ -29,10 +29,6 @@ type conPty struct {
|
||||
tty *conpty.ConPty
|
||||
}
|
||||
|
||||
func init() {
|
||||
isWin10 = VersionCheck()
|
||||
}
|
||||
|
||||
func VersionCheck() bool {
|
||||
hi, err := host.Info()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user