mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Remove return value of Alert/Confirm/Prompt
This might seem controversial; in many cases the client code gets longer, because it needs an extra line for an explicit `return nil`. I still prefer this, because it makes it clearer which calls can return errors.
This commit is contained in:
@ -75,7 +75,8 @@ func (self *UpdateHelper) onUpdateFinish(err error) error {
|
||||
)
|
||||
return errors.New(errMessage)
|
||||
}
|
||||
return self.c.Alert(self.c.Tr.UpdateCompletedTitle, self.c.Tr.UpdateCompleted)
|
||||
self.c.Alert(self.c.Tr.UpdateCompletedTitle, self.c.Tr.UpdateCompleted)
|
||||
return nil
|
||||
})
|
||||
|
||||
return nil
|
||||
@ -88,7 +89,7 @@ func (self *UpdateHelper) showUpdatePrompt(newVersion string) error {
|
||||
},
|
||||
)
|
||||
|
||||
return self.c.Confirm(types.ConfirmOpts{
|
||||
self.c.Confirm(types.ConfirmOpts{
|
||||
Title: self.c.Tr.UpdateAvailableTitle,
|
||||
Prompt: message,
|
||||
HandleConfirm: func() error {
|
||||
@ -96,4 +97,6 @@ func (self *UpdateHelper) showUpdatePrompt(newVersion string) error {
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user