diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-24 13:06:42 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-30 18:51:23 +1000 |
commit | e33fe37a99d4b3866970b1b2f40169d1bc9afa2e (patch) | |
tree | 0027f612fb72b2603044d04389da0236df28d864 /pkg/commands/git_commands/stash_loader.go | |
parent | ea54cb6e9c07ebca4a53e691fcb3cf993c793a50 (diff) |
Standardise on using lo for slice functions
We've been sometimes using lo and sometimes using my slices package, and we need to pick one
for consistency. Lo is more extensive and better maintained so we're going with that.
My slices package was a superset of go's own slices package so in some places I've just used
the official one (the methods were just wrappers anyway).
I've also moved the remaining methods into the utils package.
Diffstat (limited to 'pkg/commands/git_commands/stash_loader.go')
-rw-r--r-- | pkg/commands/git_commands/stash_loader.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/commands/git_commands/stash_loader.go b/pkg/commands/git_commands/stash_loader.go index e5ea1da49..1ab0e0ad0 100644 --- a/pkg/commands/git_commands/stash_loader.go +++ b/pkg/commands/git_commands/stash_loader.go @@ -5,11 +5,11 @@ import ( "strconv" "strings" - "github.com/jesseduffield/generics/slices" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/utils" + "github.com/samber/lo" ) type StashLoader struct { @@ -69,7 +69,7 @@ func (self *StashLoader) getUnfilteredStashEntries() []*models.StashEntry { cmdArgs := NewGitCmd("stash").Arg("list", "-z", "--pretty=%gs").ToArgv() rawString, _ := self.cmd.New(cmdArgs).DontLog().RunWithOutput() - return slices.MapWithIndex(utils.SplitNul(rawString), func(line string, index int) *models.StashEntry { + return lo.Map(utils.SplitNul(rawString), func(line string, index int) *models.StashEntry { return self.stashEntryFromLine(line, index) }) } |