make lint happy

This commit is contained in:
源文雨 2023-02-28 18:33:36 +08:00
parent d85865825e
commit 67a1050df6
2 changed files with 5 additions and 3 deletions

2
go.mod
View File

@ -40,6 +40,7 @@ require (
github.com/wdvxdr1123/ZeroBot v1.6.9
gitlab.com/gomidi/midi/v2 v2.0.25
golang.org/x/image v0.3.0
golang.org/x/sys v0.4.0
golang.org/x/text v0.6.0
gopkg.in/yaml.v3 v3.0.1
)
@ -85,7 +86,6 @@ require (
golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f // indirect
golang.org/x/mod v0.6.0 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/tools v0.2.0 // indirect
modernc.org/libc v1.21.5 // indirect
modernc.org/mathutil v1.5.0 // indirect

View File

@ -11,15 +11,17 @@ import (
func init() {
k32 := windows.NewLazySystemDLL("kernel32.dll")
getstdhandle := k32.NewProc("GetStdHandle")
h, _, err := getstdhandle.Call(uintptr(0xffffffff_fffffff6)) // STD_INPUT_HANDLE = ((DWORD)-10)
magic := -10
h, _, err := getstdhandle.Call(uintptr(magic)) // STD_INPUT_HANDLE = ((DWORD)-10)
if int(h) == 0 || int(h) == -1 {
panic(err)
}
magic--
h, _, err = k32.NewProc("SetConsoleMode").Call(h, uintptr(0x02a7)) // 禁用快速编辑
if h == 0 {
panic(err)
}
h, _, err = getstdhandle.Call(uintptr(0xffffffff_fffffff5)) // STD_OUTPUT_HANDLE = ((DWORD)-11)
h, _, err = getstdhandle.Call(uintptr(magic)) // STD_OUTPUT_HANDLE = ((DWORD)-11)
if int(h) == 0 || int(h) == -1 {
panic(err)
}