use new wg pattern

Tai Groot created

Change summary

internal/agent/tools/diagnostics.go | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

Detailed changes

internal/agent/tools/diagnostics.go 🔗

@@ -81,11 +81,9 @@ func waitForLSPDiagnostics(
 		if !client.HandlesFile(filepath) {
 			continue
 		}
-		wg.Add(1)
-		go func() {
-			defer wg.Done()
+		wg.Go(func() {
 			client.WaitForDiagnostics(waitCtx, timeout)
-		}()
+		})
 	}
 	wg.Wait()
 }