Details

    • Type: Language-Specification
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Impact:
      Unknown 'null' severity
    • Likelihood:
      Unknown 'null' severity

      Description

      Noncompliant Code Example

      func compute(a int, b int) {
      	sum := a + b
      	if  sum > 0 { } // Noncompliant; empty on purpose or missing piece of code?
      	fmt.Println("Result:", sum)
      }
      

      Compliant Solution

      func compute(a int, b int) {
      	sum := a + b
      	if  sum > 0 {
      		fmt.Println("Positive result")
      	}
      	fmt.Println("Result:", sum)
      }
      

      Exceptions

      When a block contains a comment, this block is not considered to be empty. for without init and post statements with empty blocks are ignored as well.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alexandre.gigleux Alexandre Gigleux
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: