Skip to content

Commit

Permalink
Replaced path package with filepath for correct path concatenation on…
Browse files Browse the repository at this point in the history
… Windows.
  • Loading branch information
kuredoro committed Oct 31, 2020
1 parent 7b6cf20 commit 480049f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/cptest/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"

"github.com/kuredoro/cptest"
)

func joinIfRelative(dir, filepath string) string {
if filepath != "" && filepath[0] == '/' {
return filepath
func joinIfRelative(dir, file string) string {
if file != "" && file[0] == '/' {
return file
}

return path.Join(dir, filepath)
return filepath.Join(dir, file)
}

func ReadInputs(inputsPath string) (cptest.Inputs, []error) {
Expand Down Expand Up @@ -76,7 +76,7 @@ func FindExecutable(dirPath string) (string, error) {

var execs []string
for _, name := range names {
name = path.Join(wd, name)
name = filepath.Join(wd, name)
if IsExec(name) == nil {
execs = append(execs, name)
}
Expand Down

0 comments on commit 480049f

Please sign in to comment.