From dcd7ca78fca74e870a2e1edc0b03fa808fca96b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 6 Jul 2022 14:44:51 +0800 Subject: [PATCH] Rename find path --- constant/path.go | 2 +- route/router.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/constant/path.go b/constant/path.go index 015d134d..61486b2f 100644 --- a/constant/path.go +++ b/constant/path.go @@ -11,7 +11,7 @@ const dirName = "sing-box" var resourcePaths []string -func Find(name string) (string, bool) { +func FindPath(name string) (string, bool) { name = os.ExpandEnv(name) if rw.FileExists(name) { return name, true diff --git a/route/router.go b/route/router.go index de3f45bc..7643c12e 100644 --- a/route/router.go +++ b/route/router.go @@ -307,7 +307,7 @@ func (r *Router) prepareGeoIPDatabase() error { geoPath = r.geoIPOptions.Path } else { geoPath = "geoip.db" - if foundPath, loaded := C.Find(geoPath); loaded { + if foundPath, loaded := C.FindPath(geoPath); loaded { geoPath = foundPath } } @@ -342,7 +342,7 @@ func (r *Router) prepareGeositeDatabase() error { geoPath = r.geoIPOptions.Path } else { geoPath = "geosite.db" - if foundPath, loaded := C.Find(geoPath); loaded { + if foundPath, loaded := C.FindPath(geoPath); loaded { geoPath = foundPath } }