From 7ada4e9328ea5423141141962a08a9da2fea247a Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 12 Mar 2025 21:03:52 +0000 Subject: [PATCH] remove the done channel add prune task to Taskfile --- Taskfile.yaml | 5 +++++ cmd/gen/main.go | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 76cd25e..2472c69 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -64,3 +64,8 @@ tasks: desc: Clean the build artifacts cmds: - '{{.SHELL}} rm -r {{.BIN_DIR}}' + + prune: + desc: Empty the gitignoreio template registry + cmds: + - '{{.SHELL}} rm internal/registry/templates/gitignoreio/*.gitignore' diff --git a/cmd/gen/main.go b/cmd/gen/main.go index a84d269..11ef6f2 100644 --- a/cmd/gen/main.go +++ b/cmd/gen/main.go @@ -21,7 +21,6 @@ func main() { } errChan := make(chan error) - doneChan := make(chan struct{}) for _, template := range templates { go func() { @@ -30,15 +29,13 @@ func main() { errChan <- fmt.Errorf("Failed to create template %s: %v", template.Name, err) return } - doneChan <- struct{}{} + errChan <- nil }() } for range templates { - select { - case err := <-errChan: + if err := <-errChan; err != nil { log.Error(err) - case <-doneChan: } } }