From 84c1da510897f945097d6a06d9df2da38d0abb9d Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 15 Oct 2024 13:42:12 +0200 Subject: fix(kdev): Pass by reference --- cmd/kdev/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd/kdev') diff --git a/cmd/kdev/main.go b/cmd/kdev/main.go index f639716..bbf06d7 100644 --- a/cmd/kdev/main.go +++ b/cmd/kdev/main.go @@ -72,7 +72,7 @@ func main() { kcore.Expect(err, "Error getting HEAD") head, err := repo.CommitObject(ref.Hash()) kcore.Expect(err, "Error getting commit object") - kcore.Expect(walkRepo(keywords, head, records), "Error walking directory") + kcore.Expect(walkRepo(keywords, head, &records), "Error walking directory") records = lo.Filter(records, func(record Record, index int) bool { return record.date.After(after) }) if *sortBy == "random" { @@ -86,7 +86,7 @@ func main() { } } -func walkRepo(keywords []string, head *object.Commit, records []Record) error { +func walkRepo(keywords []string, head *object.Commit, records *[]Record) error { progress := progressbar.Default(-1, "Scanning") return filepath.WalkDir(*repoPath, func(path string, d fs.DirEntry, err error) error { relativePath := strings.TrimPrefix(path, *repoPath) @@ -106,7 +106,7 @@ func walkRepo(keywords []string, head *object.Commit, records []Record) error { } if !d.IsDir() { kcore.Expect(progress.Add(1), "Error incrementing progress") - return processFile(*repoPath, relativePath, keywords, &records, head) + return processFile(*repoPath, relativePath, keywords, records, head) } return nil }) -- cgit v1.3