diff --git a/list.go b/list.go index 178f316a..4c9c944b 100644 --- a/list.go +++ b/list.go @@ -36,6 +36,7 @@ var listCommand = cli.Command{ fmt.Printf("Repositories for %s\n", r.Domain) var ( + l sync.Mutex wg sync.WaitGroup repoTags = map[string][]string{} ) @@ -50,7 +51,11 @@ var listCommand = cli.Command{ } // Sort the tags sort.Strings(tags) + + // Lock on the write to the map. + l.Lock() repoTags[repo] = tags + l.Unlock() wg.Done() }(repo)