19 lines
367 B
Go
19 lines
367 B
Go
//go:build linux
|
|
|
|
package main
|
|
|
|
import "errors"
|
|
|
|
func getHostsFileLocation() (string, error) {
|
|
var hostsFileLocation string
|
|
hostsFileLocation = "/etc/hosts"
|
|
exists, err := fileExists(hostsFileLocation)
|
|
if err != nil {
|
|
term(err)
|
|
}
|
|
if exists == false {
|
|
term(errors.New("hosts file does not exist at " + hostsFileLocation))
|
|
}
|
|
return hostsFileLocation, nil
|
|
}
|