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

[GO] FP in S1192: struct tags should not be considered as String literals

    XMLWordPrintable

    Details

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

      Description

      Struct tags are considered as String literals, triggering S1192 (duplicated string), even though a constant can not replace the duplicated string.

      type AccessRequest struct {
       Id string "id"
       Name string "name"
       Status string "status"
      }
      

      If multiple structs contain the same tag, the rule will trigger a false positive.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              amelie.renard Amélie Renard
              Reporter:
              quentin.jaquier Quentin Jaquier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: