Skip to content

Commit

Permalink
Merge pull request #2 from IvanDmytrenko/master
Browse files Browse the repository at this point in the history
Use stdlib join for file paths instead of concatenation
  • Loading branch information
miladrahimi authored Jan 28, 2020
2 parents 7d7de7d + 6aaa5f6 commit 76441a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"bufio"
"errors"
"os"
"path/filepath"
"strings"
)

Expand All @@ -16,7 +17,7 @@ func Load(filename string) (map[string]string, error) {
return nil, err
}

path := wd + string(os.PathSeparator) + filename
path := filepath.Join(wd, string(filepath.Separator), filename)
file, err := os.Open(path)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions feeder/json_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package feeder

import (
"io/ioutil"
"os"
"path/filepath"
"strings"
)

Expand All @@ -25,7 +25,7 @@ func (jd JsonDirectory) Feed() (map[string]interface{}, error) {
continue
}

j := Json{Path: jd.Path + string(os.PathSeparator) + f.Name()}
j := Json{Path: filepath.Join(jd.Path, string(filepath.Separator), f.Name())}

items, err := j.Feed()
if err != nil {
Expand Down

0 comments on commit 76441a8

Please sign in to comment.