diff --git a/v2/box_test.go b/v2/box_test.go index 41477f5..75fc8c4 100644 --- a/v2/box_test.go +++ b/v2/box_test.go @@ -227,27 +227,27 @@ func Test_Box_HasDir(t *testing.T) { func Test_Box_Traversal_Standard(t *testing.T) { r := require.New(t) box := New("Test_Box_Traversal_Standard", "") - _, err := box.FindString("../go.mod") + _, err := box.FindString("../fixtures/hello.txt") r.Error(err) } func Test_Box_Traversal_Standard_Depth2(t *testing.T) { r := require.New(t) box := New("Test_Box_Traversal_Standard_Depth2", "") - _, err := box.FindString("../../packr/go.mod") + _, err := box.FindString("../../packr/fixtures/hello.txt") r.Error(err) } func Test_Box_Traversal_Backslash(t *testing.T) { r := require.New(t) box := New("Test_Box_Traversal_Backslash", "") - _, err := box.FindString("..\\go.mod") + _, err := box.FindString("..\\fixtures\\hello.txt") r.Error(err) } func Test_Box_Traversal_Backslash_Depth2(t *testing.T) { r := require.New(t) box := New("Test_Box_Traversal_Backslash_Depth2", "") - _, err := box.FindString("..\\..packr2\\go.mod") + _, err := box.FindString("..\\..\\packr2\\fixtures\\hello.txt") r.Error(err) } diff --git a/v2/file/resolver/disk.go b/v2/file/resolver/disk.go index 10b07c4..4367c8a 100644 --- a/v2/file/resolver/disk.go +++ b/v2/file/resolver/disk.go @@ -45,8 +45,8 @@ func (d *Disk) Resolve(box string, name string) (file.File, error) { return nil, os.ErrNotExist } -// resolvePathInBase returns a path that is guaranteed to be inside of the base directory or an error -func ResolvePathInBase(base string, path string) (string, error) { +// ResolvePathInBase returns a path that is guaranteed to be inside of the base directory or an error +func ResolvePathInBase(base, path string) (string, error) { // Determine the absolute file path of the base directory d, err := filepath.Abs(base) if err != nil {