Skip to content

Commit

Permalink
Merge pull request #73 from whereswaldon/patch-1
Browse files Browse the repository at this point in the history
[Windows] harden system DLL loading
  • Loading branch information
mattn authored Jan 10, 2025
2 parents 603fb50 + 40e70a5 commit 4503567
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions colorable_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"strings"
"sync"
"syscall"
syscall "golang.org/x/sys/windows"
"unsafe"

"github.com/mattn/go-isatty"
Expand Down Expand Up @@ -73,7 +73,7 @@ type consoleCursorInfo struct {
}

var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
kernel32 = syscall.NewLazySystemDLL("kernel32.dll")
procGetConsoleScreenBufferInfo = kernel32.NewProc("GetConsoleScreenBufferInfo")
procSetConsoleTextAttribute = kernel32.NewProc("SetConsoleTextAttribute")
procSetConsoleCursorPosition = kernel32.NewProc("SetConsoleCursorPosition")
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module github.com/mattn/go-colorable

require github.com/mattn/go-isatty v0.0.16
require (
github.com/mattn/go-isatty v0.0.16
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
)

go 1.15

0 comments on commit 4503567

Please sign in to comment.