style: fix typo (#1592)

* style: fix typo

* style: add comment
This commit is contained in:
MaineK00n
2023-02-22 15:59:47 +09:00
committed by GitHub
parent 897fef24a3
commit 4e486dae1d
13 changed files with 16 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ type ChatWorkWriter struct {
Proxy string
}
// Write results to ChatWork
func (w ChatWorkWriter) Write(rs ...models.ScanResult) (err error) {
for _, r := range rs {

View File

@@ -23,6 +23,7 @@ type EMailWriter struct {
Cnf config.SMTPConf
}
// Write results to Email
func (w EMailWriter) Write(rs ...models.ScanResult) (err error) {
var message string
sender := NewEMailSender(w.Cnf)

View File

@@ -21,6 +21,7 @@ type GoogleChatWriter struct {
Proxy string
}
// Write results to Google Chat
func (w GoogleChatWriter) Write(rs ...models.ScanResult) (err error) {
re := regexp.MustCompile(w.Cnf.ServerNameRegexp)

View File

@@ -28,6 +28,7 @@ type LocalFileWriter struct {
Gzip bool
}
// Write results to Local File
func (w LocalFileWriter) Write(rs ...models.ScanResult) (err error) {
if w.FormatOneLineText {
path := filepath.Join(w.CurrentDir, "summary.txt")

View File

@@ -17,6 +17,7 @@ import (
"github.com/future-architect/vuls/models"
)
// GenerateCycloneDX generates a string in CycloneDX format
func GenerateCycloneDX(format cdx.BOMFileFormat, r models.ScanResult) ([]byte, error) {
bom := cdx.NewBOM()
bom.SerialNumber = uuid.New().URN()

View File

@@ -33,6 +33,7 @@ type message struct {
Attachments []slack.Attachment `json:"attachments"`
}
// Write results to Slack
func (w SlackWriter) Write(rs ...models.ScanResult) (err error) {
for _, r := range rs {

View File

@@ -23,6 +23,7 @@ func (w StdoutWriter) WriteScanSummary(rs ...models.ScanResult) {
fmt.Printf("%s\n", formatScanSummary(rs...))
}
// Write results to stdout
func (w StdoutWriter) Write(rs ...models.ScanResult) error {
if w.FormatOneLineText {
fmt.Print("\n\n")

View File

@@ -16,6 +16,7 @@ type SyslogWriter struct {
Cnf config.SyslogConf
}
// Write results to syslog
func (w SyslogWriter) Write(rs ...models.ScanResult) (err error) {
facility, _ := w.Cnf.GetFacility()
severity, _ := w.Cnf.GetSeverity()

View File

@@ -21,6 +21,7 @@ type TelegramWriter struct {
Proxy string
}
// Write results to Telegram
func (w TelegramWriter) Write(rs ...models.ScanResult) (err error) {
for _, r := range rs {
msgs := []string{fmt.Sprintf("*%s*\n%s\n%s\n%s",