1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-17 00:18:05 +02:00

chore: use errors.New to replace fmt.Errorf with no parameters.

This commit is contained in:
ChengenH
2024-04-24 16:21:34 +08:00
parent 0a5e9b2d60
commit dd6bfa1680
4 changed files with 12 additions and 9 deletions

View File

@ -2,6 +2,7 @@ package utils
import (
"bytes"
"errors"
"fmt"
"os"
"slices"
@ -48,7 +49,7 @@ func EditRebaseTodo(filePath string, changes []TodoChange, commentChar byte) err
if matchCount < len(changes) {
// Should never get here
return fmt.Errorf("Some todos not found in git-rebase-todo")
return errors.New("Some todos not found in git-rebase-todo")
}
return WriteRebaseTodoFile(filePath, todos, commentChar)
@ -197,7 +198,7 @@ func moveTodoUp(todos []todo.Todo, todoToMove Todo) ([]todo.Todo, error) {
if !ok {
// We expect callers to guard against this
return []todo.Todo{}, fmt.Errorf("Destination position for moving todo is out of range")
return []todo.Todo{}, errors.New("Destination position for moving todo is out of range")
}
destinationIdx := sourceIdx + 1 + skip