diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2024-04-08 09:31:14 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-08 09:31:14 +1000 |
commit | 426375b7cdc6727a49a5caab051b82b00babbdc2 (patch) | |
tree | 5a71a868efe921c21302d854cdae2f1845c384f5 /pkg/gui/filetree/file_tree.go | |
parent | ed61b9a7f2e2ca07643ded8e33a6d38e57f32b22 (diff) | |
parent | f933a2f7ec2e0ab280d41a7d1582729c1acab92b (diff) |
Replace min/max helpers with built-in min/max (#3482)
- **PR Description**
We upgraded our minimum Go version to 1.21 in commit
57ac9c2189458a7f0e63c2e9cac8334694a3d545. 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
- **Please check if the PR fulfills these requirements**
* [x] Cheatsheets are up-to-date (run `go generate ./...`)
* [x] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [ ] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [ ] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [ ] Docs (specifically `docs/Config.md`) have been updated if
necessary
* [x] You've read through your own file changes for silly mistakes etc
<!--
Be sure to name your PR with an imperative e.g. 'Add worktrees view'
see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for
examples
-->
Diffstat (limited to 'pkg/gui/filetree/file_tree.go')
-rw-r--r-- | pkg/gui/filetree/file_tree.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/gui/filetree/file_tree.go b/pkg/gui/filetree/file_tree.go index b80499cfd..f2108ab28 100644 --- a/pkg/gui/filetree/file_tree.go +++ b/pkg/gui/filetree/file_tree.go @@ -5,7 +5,6 @@ import ( "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/gui/types" - "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" "github.com/sirupsen/logrus" ) @@ -140,7 +139,7 @@ func (self *FileTree) GetAllItems() []*FileNode { func (self *FileTree) Len() int { // -1 because we're ignoring the root - return utils.Max(self.tree.Size(self.collapsedPaths)-1, 0) + return max(self.tree.Size(self.collapsedPaths)-1, 0) } func (self *FileTree) GetItem(index int) types.HasUrn { |