File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,18 +69,16 @@ func hasNoResults(report Report) bool {
6969}
7070
7171func 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
8684func getResults (report Report ) []Results {
You can’t perform that action at this time.
0 commit comments