Skip to content

Commit

Permalink
internal/vulncheck: improve documentation
Browse files Browse the repository at this point in the history
And refactor some code.

Change-Id: I658954d8670861cc36413c78c763cc2225716f15
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/594218
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Ian Cottrell <[email protected]>
  • Loading branch information
zpavlinovic committed Jun 25, 2024
1 parent d44b651 commit 055425f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions internal/vulncheck/witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,14 +437,13 @@ func uniqueVulns(vulns []*Vuln) []*Vuln {
}

// isExported checks if the symbol is exported. Assumes that the
// symbol is of the form "identifier" or "identifier1.identifier2".
// symbol is of the form "identifier", "identifier1.identifier2",
// or "identifier.".
func isExported(symbol string) bool {
parts := strings.Split(symbol, ".")
if len(parts) == 1 {
return unicode.IsUpper(rune(symbol[0]))
}
if len(parts[1]) > 0 {
return unicode.IsUpper(rune(parts[1][0]))
last := parts[len(parts)-1]
if last == "" { // case for "identifier."
return false
}
return false
return unicode.IsUpper(rune(last[0]))
}

0 comments on commit 055425f

Please sign in to comment.