From 40197ae1570b259f15c8ccead3860050e324f7c2 Mon Sep 17 00:00:00 2001 From: kristijorgji Date: Fri, 15 Mar 2024 16:36:16 +0100 Subject: [PATCH] change FromJson source utility to not append automatically the environment folder to the provided file name --- sources.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sources.go b/sources.go index 820e1e2..ef5f4e6 100644 --- a/sources.go +++ b/sources.go @@ -17,11 +17,7 @@ func SetDataPath(path string) { //FromJson inserts into a database table with name same as the filename all the json entries func (s Seeder) FromJson(filename string) { - var folder = "" - if s.context.env != "" { - folder = fmt.Sprintf("%s/", s.context.env) - } - content, err := ioutil.ReadFile(fmt.Sprintf("%s/%s%s.json", dataPath, folder, filename)) + content, err := ioutil.ReadFile(fmt.Sprintf("%s/%s.json", dataPath, filename)) if err != nil { log.Fatal(err) }