Skip to content

Commit

Permalink
Fix typos and receiver names
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed May 15, 2021
1 parent 8b35f3d commit bebdceb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions internal/chezmoi/actualstateentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,42 +79,42 @@ func NewActualStateEntry(system System, absPath AbsPath, info os.FileInfo, err e
}
}

// EntryState returns d's entry state.
// EntryState returns s's entry state.
func (s *ActualStateAbsent) EntryState() (*EntryState, error) {
return &EntryState{
Type: EntryStateTypeRemove,
}, nil
}

// Path returns d's path.
// Path returns s's path.
func (s *ActualStateAbsent) Path() AbsPath {
return s.absPath
}

// Remove removes d.
// Remove removes s.
func (s *ActualStateAbsent) Remove(system System) error {
return nil
}

// EntryState returns d's entry state.
// EntryState returns s's entry state.
func (s *ActualStateDir) EntryState() (*EntryState, error) {
return &EntryState{
Type: EntryStateTypeDir,
Mode: os.ModeDir | s.perm,
}, nil
}

// Path returns d's path.
// Path returns s's path.
func (s *ActualStateDir) Path() AbsPath {
return s.absPath
}

// Remove removes d.
// Remove removes s.
func (s *ActualStateDir) Remove(system System) error {
return system.RemoveAll(s.absPath)
}

// EntryState returns d's entry state.
// EntryState returns s's entry state.
func (s *ActualStateFile) EntryState() (*EntryState, error) {
contents, err := s.Contents()
if err != nil {
Expand All @@ -132,17 +132,17 @@ func (s *ActualStateFile) EntryState() (*EntryState, error) {
}, nil
}

// Path returns d's path.
// Path returns s's path.
func (s *ActualStateFile) Path() AbsPath {
return s.absPath
}

// Remove removes d.
// Remove removes s.
func (s *ActualStateFile) Remove(system System) error {
return system.RemoveAll(s.absPath)
}

// EntryState returns d's entry state.
// EntryState returns s's entry state.
func (s *ActualStateSymlink) EntryState() (*EntryState, error) {
linkname, err := s.Linkname()
if err != nil {
Expand All @@ -159,12 +159,12 @@ func (s *ActualStateSymlink) EntryState() (*EntryState, error) {
}, nil
}

// Path returns d's path.
// Path returns s's path.
func (s *ActualStateSymlink) Path() AbsPath {
return s.absPath
}

// Remove removes d.
// Remove removes s.
func (s *ActualStateSymlink) Remove(system System) error {
return system.RemoveAll(s.absPath)
}
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func cmdMkFile(ts *testscript.TestScript, neg bool, args []string) {
// cmdMkAGEConfig creates a AGE key and a chezmoi configuration file.
func cmdMkAGEConfig(ts *testscript.TestScript, neg bool, args []string) {
if neg {
ts.Fatalf("unupported: ! mkageconfig")
ts.Fatalf("unsupported: ! mkageconfig")
}
if len(args) > 0 {
ts.Fatalf("usage: mkageconfig")
Expand Down Expand Up @@ -239,7 +239,7 @@ func cmdMkGitConfig(ts *testscript.TestScript, neg bool, args []string) {
// cmdMkGPGConfig creates a GPG key and a chezmoi configuration file.
func cmdMkGPGConfig(ts *testscript.TestScript, neg bool, args []string) {
if neg {
ts.Fatalf("unupported: ! mkgpgconfig")
ts.Fatalf("unsupported: ! mkgpgconfig")
}
if len(args) > 1 || len(args) == 1 && args[0] != "-symmetric" {
ts.Fatalf("usage: mkgpgconfig [-symmetric]")
Expand Down

0 comments on commit bebdceb

Please sign in to comment.