Skip to content

Commit cc4c660

Browse files
removed unnecessary variable
1 parent 4e6a16e commit cc4c660

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

lib/reporting/sarif.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,16 @@ func hasNoResults(report Report) bool {
6969
}
7070

7171
func messageText(ruleName string, filePath string) string {
72-
finalPath := filePath
73-
7472
// maintain only the filename if the scan target is git
75-
if strings.HasPrefix(finalPath, "git show ") {
76-
trimmed := strings.TrimPrefix(finalPath, "git show ")
73+
if strings.HasPrefix(filePath, "git show ") {
74+
trimmed := strings.TrimPrefix(filePath, "git show ")
7775
parts := strings.Split(trimmed, ":")
7876
if len(parts) == 2 {
79-
finalPath = strings.ReplaceAll(parts[1], "/", "\\")
77+
filePath = strings.ReplaceAll(parts[1], "/", "\\")
8078
}
8179
}
8280

83-
return fmt.Sprintf("%s has detected secret for file %s.", ruleName, finalPath)
81+
return fmt.Sprintf("%s has detected secret for file %s.", ruleName, filePath)
8482
}
8583

8684
func getResults(report Report) []Results {

0 commit comments

Comments
 (0)