sing-box/dns/transport/hosts/hosts_windows.go

18 lines
298 B
Go
Raw Normal View History

2024-12-02 15:17:01 +00:00
package hosts
import (
"path/filepath"
"golang.org/x/sys/windows"
)
var DefaultPath string
func init() {
systemDirectory, err := windows.GetSystemDirectory()
if err != nil {
systemDirectory = "C:\\Windows\\System32"
}
DefaultPath = filepath.Join(systemDirectory, "Drivers/etc/hosts")
}