- Version 6.7.3 (build 38370)
- Sonar reports duplicate literal for json struct tags used in GoLang. I think there should be an option to either ignore all the json tags in GoLang, or by default sonar should not mark json tag strings as having duplicate string literal.
Example code below:
type AccessRequest struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
}
In above example if there are multiple structs which has “json:"status"
”, then sonar will report it as critical issue. Like below:
Define a constant instead of duplicating this literal 4 times.
Code SmellCritical
Please provide a way to ignore this or ignore this by default.