Skip to content

Commit

Permalink
make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Feb 28, 2023
1 parent d858658 commit 67a1050
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 67a1050

Please sign in to comment.