rules:
  - id: hidden-goroutine
    patterns:
      - pattern-not: |
          func $FUNC(...) {
            go func() {
              ...
            }(...)
            $MORE
          }
      - pattern: |
          func $FUNC(...) {
            go func() {
              ...
            }(...)
          }
    message: >-
      Detected a hidden goroutine. Function invocations are expected to synchronous,
      and this function will execute asynchronously because all it does is call a
      goroutine. Instead, remove the internal goroutine and call the function using
      'go'.
    languages: [go]
    severity: WARNING
    metadata:
      category: best-practice
      technology:
        - go
