Skip to content

Commit

Permalink
change FromJson source utility to not append automatically the enviro…
Browse files Browse the repository at this point in the history
…nment folder to the provided file name
  • Loading branch information
kristijorgji committed Mar 15, 2024
1 parent 9ca4167 commit 40197ae
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 40197ae

Please sign in to comment.