fixup calls to path.Join with filepath.Join

This commit is contained in:
Matthew Fisher 2018-04-12 09:11:11 -07:00
Родитель 63124095da
Коммит 14759a4611
2 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -6,7 +6,6 @@ import (
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"unicode"
@ -189,7 +188,7 @@ func doPackDetection(home draftpath.Home, out io.Writer) (string, error) {
detectedLang := linguist.Alias(lang)
fmt.Fprintf(out, "--> Draft detected %s (%f%%)\n", detectedLang.Language, detectedLang.Percent)
for _, repository := range repo.FindRepositories(home.Packs()) {
packDir := path.Join(repository.Dir, repo.PackDirName)
packDir := filepath.Join(repository.Dir, repo.PackDirName)
packs, err := ioutil.ReadDir(packDir)
if err != nil {
return "", fmt.Errorf("there was an error reading %s: %v", packDir, err)

Просмотреть файл

@ -3,7 +3,7 @@ package osutil
import (
"io/ioutil"
"os"
"path"
"path/filepath"
"runtime"
"testing"
)
@ -42,10 +42,10 @@ func TestSymlinkWithFallback(t *testing.T) {
}
defer os.RemoveAll(tmpDir)
oldFileNamePath := path.Join(tmpDir, oldFileName)
newFileNamePath := path.Join(tmpDir, newFileName)
oldFileNamePath := filepath.Join(tmpDir, oldFileName)
newFileNamePath := filepath.Join(tmpDir, newFileName)
oldFile, err := os.Create(path.Join(tmpDir, oldFileName))
oldFile, err := os.Create(filepath.Join(tmpDir, oldFileName))
if err != nil {
t.Fatal(err)
}