Skip to content

Commit

Permalink
Rename the file.name to file.path
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiade committed Jul 7, 2023
1 parent 960d212 commit 09f7ef7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/modules/k6/experimental/fs/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
// file is an abstraction for interacting with files.
type file struct {
// name holds the name of the file, as presented to [Open].
name string
path string

// data holds a pointer to the file's data
data []byte
}

// Stat returns a FileInfo describing the named file.
func (f *file) Stat() *FileInfo {
basepath := path.Base(f.name)
basepath := path.Base(f.path)
return &FileInfo{Name: basepath, Size: len(f.data)}
}

Expand Down
2 changes: 1 addition & 1 deletion js/modules/k6/experimental/fs/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (mi *ModuleInstance) open(path string) (goja.Value, error) {
file := File{
Name: path,
file: file{
name: path,
path: path,
data: data,
},
vu: mi.vu,
Expand Down

0 comments on commit 09f7ef7

Please sign in to comment.