mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
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.
This commit is contained in:
pkg
app
cheatsheet
commands
git_commands
bisect_info.gobranch_loader.gocommit_file_loader.gocommit_loader.gorebase.goremote_loader.gostash_loader.gotag_loader.go
hosting_service
oscommands
patch
gui
context.go
context
controllers
custom_command_action.go
helpers
merge_and_rebase_helper.gomode_helper.gorefresh_helper.gorefs_helper.gorepos_helper.gosuggestions_helper.goupstream_helper_test.go
options_menu_action.gostatus_controller.gofiletree
layout.gomodes
cherrypicking
presentation
branches.go
graph
reflog_commits.goremote_branches.goremotes.gostash_entries.gosubmodules.gosuggestions.gotags.goservices
custom_commands
status
views.gointegration
utils
vendor
@ -11,7 +11,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/fsmiamoto/git-todo-parser/todo"
|
||||
"github.com/jesseduffield/generics/slices"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
|
||||
@ -233,7 +232,7 @@ func (self *CommitLoader) getHydratedRebasingCommits(rebaseMode enums.RebaseMode
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
commitShas := slices.FilterMap(commits, func(commit *models.Commit) (string, bool) {
|
||||
commitShas := lo.FilterMap(commits, func(commit *models.Commit, _ int) (string, bool) {
|
||||
return commit.Sha, commit.Sha != ""
|
||||
})
|
||||
|
||||
@ -379,7 +378,7 @@ func (self *CommitLoader) getInteractiveRebasingCommits() ([]*models.Commit, err
|
||||
// Command does not have a commit associated, skip
|
||||
continue
|
||||
}
|
||||
commits = slices.Prepend(commits, &models.Commit{
|
||||
commits = utils.Prepend(commits, &models.Commit{
|
||||
Sha: t.Commit,
|
||||
Name: t.Msg,
|
||||
Status: models.StatusRebasing,
|
||||
|
Reference in New Issue
Block a user