Uploaded image for project: 'SonarSlang'
  1. SonarSlang
  2. SONARSLANG-439

[Go] S1763 FP on function with label

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Go
    • Labels:
      None
    • Estimate:
      Hours

      Description

      The following Go code raise a FP on rule S1763: Jump statements should not be followed by dead code.

      func f(i int) string {
        if i == 42 { 
          goto label 
        } 
        return "return"
        
        label:  
          return "this code is reachable!!"
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: