Skip to content

Commit

Permalink
Fix grammar and receiver name
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Nov 19, 2019
1 parent df05dff commit 9cfd78d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/chezmoi/fsmutator.go
Expand Up @@ -7,7 +7,7 @@ import (
vfs "github.com/twpayne/go-vfs"
)

// An FSMutator makes changes to an vfs.FS.
// An FSMutator makes changes to a vfs.FS.
type FSMutator struct {
vfs.FS
devCache map[string]uint // devCache maps directories to device numbers.
Expand All @@ -24,13 +24,13 @@ func NewFSMutator(fs vfs.FS) *FSMutator {
}

// WriteSymlink implements Mutator.WriteSymlink.
func (a *FSMutator) WriteSymlink(oldname, newname string) error {
func (m *FSMutator) WriteSymlink(oldname, newname string) error {
// Special case: if writing to the real filesystem, use github.com/google/renameio
if a.FS == vfs.OSFS {
if m.FS == vfs.OSFS {
return renameio.Symlink(oldname, newname)
}
if err := a.FS.RemoveAll(newname); err != nil && !os.IsNotExist(err) {
if err := m.FS.RemoveAll(newname); err != nil && !os.IsNotExist(err) {
return err
}
return a.FS.Symlink(oldname, newname)
return m.FS.Symlink(oldname, newname)
}

0 comments on commit 9cfd78d

Please sign in to comment.