From e33fe37a99d4b3866970b1b2f40169d1bc9afa2e Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 24 Jul 2023 13:06:42 +1000 Subject: 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. --- pkg/gui/context.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/gui/context.go') diff --git a/pkg/gui/context.go b/pkg/gui/context.go index 90bb78768..d845265a3 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -4,9 +4,9 @@ import ( "errors" "sync" - "github.com/jesseduffield/generics/slices" "github.com/jesseduffield/lazygit/pkg/gui/context" "github.com/jesseduffield/lazygit/pkg/gui/types" + "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" ) @@ -134,7 +134,7 @@ func (self *ContextMgr) pushToContextStack(c types.Context) ([]types.Context, ty (topContext.GetKind() == types.MAIN_CONTEXT && c.GetKind() == types.MAIN_CONTEXT) { contextsToDeactivate = append(contextsToDeactivate, topContext) - _, self.ContextStack = slices.Pop(self.ContextStack) + _, self.ContextStack = utils.Pop(self.ContextStack) } self.ContextStack = append(self.ContextStack, c) @@ -154,7 +154,7 @@ func (self *ContextMgr) Pop() error { } var currentContext types.Context - currentContext, self.ContextStack = slices.Pop(self.ContextStack) + currentContext, self.ContextStack = utils.Pop(self.ContextStack) newContext := self.ContextStack[len(self.ContextStack)-1] -- cgit v1.2.3