mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Remove bool return value of GetParentContext()
The comments that I'm deleting here explain why we need the bool; however, in our case that's a theoretical issue. It would only arise if we ever were to pass a nil context to SetParentContext, which we never do.
This commit is contained in:
@ -4,17 +4,14 @@ import "github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
|
||||
type ParentContextMgr struct {
|
||||
ParentContext types.Context
|
||||
// we can't know on the calling end whether a Context is actually a nil value without reflection, so we're storing this flag here to tell us. There has got to be a better way around this
|
||||
hasParent bool
|
||||
}
|
||||
|
||||
var _ types.ParentContexter = (*ParentContextMgr)(nil)
|
||||
|
||||
func (self *ParentContextMgr) SetParentContext(context types.Context) {
|
||||
self.ParentContext = context
|
||||
self.hasParent = true
|
||||
}
|
||||
|
||||
func (self *ParentContextMgr) GetParentContext() (types.Context, bool) {
|
||||
return self.ParentContext, self.hasParent
|
||||
func (self *ParentContextMgr) GetParentContext() types.Context {
|
||||
return self.ParentContext
|
||||
}
|
||||
|
Reference in New Issue
Block a user