Skip to content

Commit 4d4e594

Browse files
ccojocarCosmin Cojocar
authored andcommitted
Add some comments
Signed-off-by: Cosmin Cojocar <[email protected]>
1 parent d1467ac commit 4d4e594

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

issue.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ func (c Score) String() string {
131131
return "UNDEFINED"
132132
}
133133

134+
// codeSnippet extracts a code snippet based on the ast reference
134135
func codeSnippet(file *os.File, start int64, end int64, n ast.Node) (string, error) {
135136
if n == nil {
136137
return "", fmt.Errorf("invalid AST node provided")

output/formatter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ func highlight(t string, s gosec.Score) string {
322322
}
323323
}
324324

325+
// printCodeSnippet prints the code snippet from the issue by adding a marker to the affected line
325326
func printCodeSnippet(issue *gosec.Issue) string {
326327
scanner := bufio.NewScanner(strings.NewReader(issue.Code))
327328
var buf bytes.Buffer

0 commit comments

Comments
 (0)