From 615551d0d38975509840e813efcaadca42692511 Mon Sep 17 00:00:00 2001 From: Jesse Peterson Date: Tue, 9 Jul 2024 09:33:58 -0700 Subject: [PATCH] fix for loop scoping. fixes #69, #70 --- cmd/depsyncer/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/depsyncer/main.go b/cmd/depsyncer/main.go index 1e70eeb..dbb985f 100644 --- a/cmd/depsyncer/main.go +++ b/cmd/depsyncer/main.go @@ -127,6 +127,9 @@ func main() { var wg sync.WaitGroup for _, name := range flag.Args()[0:] { + // we're attaching this to a callback which is called from + // a goroutine. so we need to re-initialize the variable scope. + name := name // create the assigner assignerOpts := []depsync.AssignerOption{