From ee5cdf81cbf999f8b139e8476f3ff0cc02e5ac8e Mon Sep 17 00:00:00 2001 From: Iftekher Sunny Date: Mon, 30 Oct 2017 13:09:13 +0600 Subject: [PATCH] Fix absolute path --- country.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/country.go b/country.go index fc9aaea..703558a 100644 --- a/country.go +++ b/country.go @@ -3,8 +3,7 @@ package country import ( "encoding/json" "io/ioutil" - "path" - "runtime" + "path/filepath" ) // Country struct @@ -27,9 +26,7 @@ func (country *Country) readCountriesDataFile() *Country { return country } - _, filename, _, _ := runtime.Caller(0) - - dataPath := path.Join(path.Dir(filename), "data/countries.json") + dataPath, _ := filepath.Abs("./data/countries.json") file, _ := ioutil.ReadFile(dataPath)