mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
20 lines
414 B
Go
20 lines
414 B
Go
//go:build !go1.22
|
|
|
|
// a simple standard lib fix from: https://github.com/golang/go/commit/33d4a5105cf2b2d549922e909e9239a48b8cefcc
|
|
|
|
package resolver
|
|
|
|
import (
|
|
"golang.org/x/sys/windows"
|
|
_ "unsafe"
|
|
)
|
|
|
|
//go:linkname testHookHostsPath net.testHookHostsPath
|
|
var testHookHostsPath string
|
|
|
|
func init() {
|
|
if dir, err := windows.GetSystemDirectory(); err == nil {
|
|
testHookHostsPath = dir + "/Drivers/etc/hosts"
|
|
}
|
|
}
|