Skip to content

Commit

Permalink
refactor: use strings.Trim
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Apr 24, 2024
1 parent 18b1383 commit 0d67966
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/fanal/analyzer/language/c/conan/conan.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func detectAttribute(attributeName, line string) string {
// e.g. `license = "Apache or MIT"` -> ` "Apache or MIT"` -> `"Apache or MIT"` -> `Apache or MIT`
if name, v, ok := strings.Cut(line, "="); ok && strings.TrimSpace(name) == attributeName {
attr := strings.TrimSpace(v)
return strings.TrimPrefix(strings.TrimSuffix(attr, "\""), "\"")
return strings.Trim(attr, `"`)
}

return ""
Expand Down

0 comments on commit 0d67966

Please sign in to comment.