geoip: homebrew default path
This commit is contained in:
11
geoipapi.go
11
geoipapi.go
@@ -153,15 +153,16 @@ func open(t geoType) (*geoip2.Reader, error) {
|
|||||||
rdr, err := geoip2.Open(fileName)
|
rdr, err := geoip2.Open(fileName)
|
||||||
|
|
||||||
return rdr, err
|
return rdr, err
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func findDB() string {
|
func findDB() string {
|
||||||
dirs := []string{
|
dirs := []string{
|
||||||
"/usr/share/GeoIP/", // Linux default
|
"/usr/share/GeoIP/", // Linux default
|
||||||
"/usr/share/local/GeoIP/", // source install?
|
"/usr/share/local/GeoIP/", // source install?
|
||||||
"/usr/local/share/GeoIP/", // FreeBSD
|
"/usr/local/share/GeoIP/", // FreeBSD
|
||||||
"/opt/local/share/GeoIP/", // MacPorts
|
"/opt/local/share/GeoIP/", // MacPorts
|
||||||
|
"/opt/homebrew/var/GeoIP/", // Homebrew
|
||||||
|
|
||||||
}
|
}
|
||||||
for _, dir := range dirs {
|
for _, dir := range dirs {
|
||||||
if _, err := os.Stat(dir); err != nil {
|
if _, err := os.Stat(dir); err != nil {
|
||||||
|
Reference in New Issue
Block a user