Skip to content

Commit

Permalink
adding custom drive support
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Oct 11, 2021
1 parent db15799 commit f4a76fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hostsfile/hostsfile.go
Expand Up @@ -2,6 +2,8 @@ package hostsfile

import (
"errors"
"fmt"
"os"
"runtime"
"strings"

Expand All @@ -11,7 +13,7 @@ import (

func Path() string {
if runtime.GOOS == "windows" {
return `C:\Windows\System32\Drivers\etc\hosts`
return fmt.Sprintf(`%s\System32\Drivers\etc\hosts`, os.Getenv("SystemRoot"))
}
return "/etc/hosts"
}
Expand Down

0 comments on commit f4a76fa

Please sign in to comment.