File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 44 "io/ioutil"
55 "math/rand"
66 "os"
7+ "path"
78 "path/filepath"
89 "sort"
910 "strings"
@@ -74,10 +75,12 @@ type CowFile struct {
7475// If LocationType is InBinary, the file read from binary.
7576// otherwise reads from file system.
7677func (c * CowFile ) ReadAll () ([]byte , error ) {
77- joinedPath := filepath .Join (c .BasePath , c .Name + ".cow" )
7878 if c .LocationType == InBinary {
79+ // go embed is used "/" separator
80+ joinedPath := path .Join (c .BasePath , c .Name + ".cow" )
7981 return Asset (joinedPath )
8082 }
83+ joinedPath := filepath .Join (c .BasePath , c .Name + ".cow" )
8184 return ioutil .ReadFile (joinedPath )
8285}
8386
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ func TestCows(t *testing.T) {
5353
5454 wants := []* CowPath {
5555 {
56- Name : "testdata/ testdir" ,
56+ Name : filepath . Join ( "testdata" , " testdir") ,
5757 LocationType : InDirectory ,
5858 },
5959 {
You can’t perform that action at this time.
0 commit comments