Skip to content

Commit 4e486da

Browse files
authored
style: fix typo (#1592)
* style: fix typo * style: add comment
1 parent 897fef2 commit 4e486da

File tree

13 files changed

+16
-1
lines changed

13 files changed

+16
-1
lines changed

detector/github.go

+1
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ func fetchDependencyGraph(r *models.ScanResult, httpClient *http.Client, owner,
298298
return nil
299299
}
300300

301+
// DependencyGraph is a GitHub API response
301302
type DependencyGraph struct {
302303
Data struct {
303304
Repository struct {

models/github.go

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
// key: BlobPath
1212
type DependencyGraphManifests map[string]DependencyGraphManifest
1313

14+
// DependencyGraphManifest has filename, repository, dependencies
1415
type DependencyGraphManifest struct {
1516
BlobPath string `json:"blobPath"`
1617
Filename string `json:"filename"`
@@ -76,13 +77,15 @@ func (m DependencyGraphManifest) Ecosystem() string {
7677
}
7778
}
7879

80+
// Dependency has dependency package information
7981
type Dependency struct {
8082
PackageName string `json:"packageName"`
8183
PackageManager string `json:"packageManager"`
8284
Repository string `json:"repository"`
8385
Requirements string `json:"requirements"`
8486
}
8587

88+
// Version returns version
8689
func (d Dependency) Version() string {
8790
s := strings.Split(d.Requirements, " ")
8891
if len(s) == 2 && s[0] == "=" {

models/vulninfos.go

+2
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ type GitHubSecurityAlert struct {
310310
DismissReason string `json:"dismissReason"`
311311
}
312312

313+
// RepoURLPackageName returns a string connecting the repository and package name
313314
func (a GitHubSecurityAlert) RepoURLPackageName() string {
314315
return fmt.Sprintf("%s %s", a.Repository, a.Package.Name)
315316
}
@@ -319,6 +320,7 @@ func (a GitHubSecurityAlert) RepoURLManifestPath() string {
319320
return fmt.Sprintf("%s/%s", a.Repository, a.Package.ManifestPath)
320321
}
321322

323+
// GSAVulnerablePackage has vulnerable package information
322324
type GSAVulnerablePackage struct {
323325
Name string `json:"name"`
324326
Ecosystem string `json:"ecosystem"`

reporter/chatwork.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type ChatWorkWriter struct {
2020
Proxy string
2121
}
2222

23+
// Write results to ChatWork
2324
func (w ChatWorkWriter) Write(rs ...models.ScanResult) (err error) {
2425

2526
for _, r := range rs {

reporter/email.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type EMailWriter struct {
2323
Cnf config.SMTPConf
2424
}
2525

26+
// Write results to Email
2627
func (w EMailWriter) Write(rs ...models.ScanResult) (err error) {
2728
var message string
2829
sender := NewEMailSender(w.Cnf)

reporter/googlechat.go

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type GoogleChatWriter struct {
2121
Proxy string
2222
}
2323

24+
// Write results to Google Chat
2425
func (w GoogleChatWriter) Write(rs ...models.ScanResult) (err error) {
2526
re := regexp.MustCompile(w.Cnf.ServerNameRegexp)
2627

reporter/localfile.go

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type LocalFileWriter struct {
2828
Gzip bool
2929
}
3030

31+
// Write results to Local File
3132
func (w LocalFileWriter) Write(rs ...models.ScanResult) (err error) {
3233
if w.FormatOneLineText {
3334
path := filepath.Join(w.CurrentDir, "summary.txt")

reporter/sbom/cyclonedx.go

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/future-architect/vuls/models"
1818
)
1919

20+
// GenerateCycloneDX generates a string in CycloneDX format
2021
func GenerateCycloneDX(format cdx.BOMFileFormat, r models.ScanResult) ([]byte, error) {
2122
bom := cdx.NewBOM()
2223
bom.SerialNumber = uuid.New().URN()

reporter/slack.go

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type message struct {
3333
Attachments []slack.Attachment `json:"attachments"`
3434
}
3535

36+
// Write results to Slack
3637
func (w SlackWriter) Write(rs ...models.ScanResult) (err error) {
3738

3839
for _, r := range rs {

reporter/stdout.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (w StdoutWriter) WriteScanSummary(rs ...models.ScanResult) {
2323
fmt.Printf("%s\n", formatScanSummary(rs...))
2424
}
2525

26+
// Write results to stdout
2627
func (w StdoutWriter) Write(rs ...models.ScanResult) error {
2728
if w.FormatOneLineText {
2829
fmt.Print("\n\n")

reporter/syslog.go

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type SyslogWriter struct {
1616
Cnf config.SyslogConf
1717
}
1818

19+
// Write results to syslog
1920
func (w SyslogWriter) Write(rs ...models.ScanResult) (err error) {
2021
facility, _ := w.Cnf.GetFacility()
2122
severity, _ := w.Cnf.GetSeverity()

reporter/telegram.go

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type TelegramWriter struct {
2121
Proxy string
2222
}
2323

24+
// Write results to Telegram
2425
func (w TelegramWriter) Write(rs ...models.ScanResult) (err error) {
2526
for _, r := range rs {
2627
msgs := []string{fmt.Sprintf("*%s*\n%s\n%s\n%s",

server/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (h VulsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
129129
return
130130
}
131131

132-
// sever subcmd doesn't have diff option
132+
// server subcmd doesn't have diff option
133133
reports = append(reports, reporter.LocalFileWriter{
134134
CurrentDir: dir,
135135
FormatJSON: true,

0 commit comments

Comments
 (0)