Skip to content

Commit

Permalink
Use v for *value instead of e
Browse files Browse the repository at this point in the history
  • Loading branch information
mojatter committed Nov 11, 2021
1 parent 130b35a commit edeafad
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions memfs/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,39 @@ var (
_ fs.FileInfo = (*value)(nil)
)

func (e *value) Name() string {
return filepath.Base(e.name)
func (v *value) Name() string {
return filepath.Base(v.name)
}

func (e *value) Size() int64 {
if e.isDir {
func (v *value) Size() int64 {
if v.isDir {
return 0
}
return int64(len(e.data))
return int64(len(v.data))
}

func (e *value) Mode() fs.FileMode {
return e.mode
func (v *value) Mode() fs.FileMode {
return v.mode
}

func (e *value) ModTime() time.Time {
return e.modTime
func (v *value) ModTime() time.Time {
return v.modTime
}

func (e *value) IsDir() bool {
return e.isDir
func (v *value) IsDir() bool {
return v.isDir
}

func (e *value) Sys() interface{} {
func (v *value) Sys() interface{} {
return nil
}

func (e *value) Type() fs.FileMode {
return e.mode
func (v *value) Type() fs.FileMode {
return v.mode
}

func (e *value) Info() (fs.FileInfo, error) {
return e, nil
func (v *value) Info() (fs.FileInfo, error) {
return v, nil
}

// Store represents an in-memory key value store.
Expand Down

0 comments on commit edeafad

Please sign in to comment.