Hidden Goroutine Info

Creating goroutines inside Go functions without explicit go invocation hides asynchronous behavior. While the function appears synchronous, it operates concurrently via the implicit goroutine. This hidden asynchronousness confuses expected function behavior. To avoid issues, internal goroutine calls should be removed from functions. Instead, explicitly invoke the function asynchronously with go to expose its concurrent nature. This makes the concurrency visible and avoids misleading synchronous function assumptions.

Detector ID
go/hidden-goroutine@v1.0
Category
Common Weakness Enumeration (CWE) external icon
-
Tags
-