From fa24620c50a56ae6c3c31575e861098d0f0ed177 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Mon, 29 Sep 2025 21:48:35 +0200 Subject: run `modernize -fix ./...` Also drop util/gocovcat.go which has been obsolete since 122068efd4a348921b736b4456d4e1c999dbfb79. --- internal/prompt/git.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/prompt/git.go') diff --git a/internal/prompt/git.go b/internal/prompt/git.go index 6f0cf1d..26291c4 100644 --- a/internal/prompt/git.go +++ b/internal/prompt/git.go @@ -57,12 +57,12 @@ func findRepo(path string) (*gitRepo, error) { if err != nil { return nil, err } - for _, line := range strings.Split(string(bytes), "\n") { + for line := range strings.SplitSeq(string(bytes), "\n") { line = strings.TrimSpace(line) - if strings.HasPrefix(line, "gitdir:") { + if gitDir, ok := strings.CutPrefix(line, "gitdir:"); ok { return &gitRepo{ RootPath: path, - GitDir: filepath.Join(path, strings.TrimSpace(strings.TrimPrefix(line, "gitdir:"))), + GitDir: filepath.Join(path, strings.TrimSpace(gitDir)), }, nil } } @@ -115,7 +115,7 @@ func tryReadFromPackedRefs(repo *gitRepo, refSpec string) string { if err != nil { return "" } - for _, line := range strings.Split(string(bytes), "\n") { + for line := range strings.SplitSeq(string(bytes), "\n") { line = strings.TrimSpace(line) if line == "" || strings.HasPrefix(line, "#") { continue -- cgit v1.3.1