From 94037bf60331c13572bc5cfdfcd3aca8bb0a8809 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 23 Mar 2018 18:45:21 +0100 Subject: [PATCH] Address sorting issues Signed-off-by: Knut Ahlers --- token.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/token.go b/token.go index 69d38eb..6d2ebbc 100644 --- a/token.go +++ b/token.go @@ -115,6 +115,7 @@ func getSecretsFromVault(tok string, pointOfTime time.Time) ([]*token, error) { go fetchTokenFromKey(client, key, respChan, wg, pointOfTime) case t := <-respChan: resp = append(resp, t) + wg.Done() case <-done: close(scanPool) close(keyPoolChan) @@ -199,5 +200,6 @@ func fetchTokenFromKey(client *api.Client, k string, respChan chan *token, wg *s return } + wg.Add(1) respChan <- tok }