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/gui/context/commit_files_context.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/gui/context/commit_files_context.go')
-rw-r--r-- | pkg/gui/context/commit_files_context.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/gui/context/commit_files_context.go b/pkg/gui/context/commit_files_context.go index 5cb11d9cc..035230e9d 100644 --- a/pkg/gui/context/commit_files_context.go +++ b/pkg/gui/context/commit_files_context.go @@ -1,12 +1,12 @@ package context import ( - "github.com/jesseduffield/generics/slices" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/gui/filetree" "github.com/jesseduffield/lazygit/pkg/gui/presentation" "github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/gui/types" + "github.com/samber/lo" ) type CommitFilesContext struct { @@ -34,7 +34,7 @@ func NewCommitFilesContext(c *ContextCommon) *CommitFilesContext { } lines := presentation.RenderCommitFileTree(viewModel, c.Modes().Diffing.Ref, c.Git().Patch.PatchBuilder) - return slices.Map(lines, func(line string) []string { + return lo.Map(lines, func(line string, _ int) []string { return []string{line} }) } |