mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 05:31:18 +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"
|
||
|
}
|
||
|
}
|