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

Replace min/max helpers with built-in min/max

We upgraded our minimum Go version to 1.21 in commit
57ac9c2189. We can now replace our
`utils.Min` and `utils.Max` functions with the built-in `min` and `max`.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2024-04-07 23:24:10 +08:00
parent ed61b9a7f2
commit f933a2f7ec
12 changed files with 20 additions and 73 deletions

View File

@ -9,8 +9,6 @@ import (
"path/filepath"
"runtime"
"time"
"github.com/jesseduffield/lazygit/pkg/utils"
)
// this is for running shell commands, mostly for the sake of setting up the repo
@ -289,7 +287,7 @@ func (self *Shell) CreateRepoHistory() *Shell {
// Choose a random commit within the last 20 commits on the master branch
lastMasterCommit := totalCommits - 1
commitOffset := rand.Intn(utils.Min(lastMasterCommit, 5)) + 1
commitOffset := rand.Intn(min(lastMasterCommit, 5)) + 1
// Create the feature branch and checkout the chosen commit
self.NewBranchFrom(branchName, fmt.Sprintf("master~%d", commitOffset))