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 --- README.md | 4 ---- cmd/kdev/main.go | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9eb235d..c421e7f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,3 @@ 2. Use `Tr("key", value...)` in you templ files 3. Complete generated files 4. Run - -## kdev - -- Add a config file for excludes 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