Skip to content

Commit 48ede6b

Browse files
committed
Fixed linter warnings
commands/service_upload.go:532:7: QF1012: Use fmt.Fprintln(...) instead of Write([]byte(fmt.Sprintln(...))) (staticcheck) outStream.Write([]byte(fmt.Sprintln(i18n.Tr("Upload port found on %s", portAddress)))) ^ commands/service_upload.go:534:7: QF1012: Use fmt.Fprintln(...) instead of Write([]byte(fmt.Sprintln(...))) (staticcheck) outStream.Write([]byte(fmt.Sprintln(i18n.Tr("No upload port found, using %s as fallback", actualPort.Address)))) ^ commands/service_upload.go:544:4: QF1012: Use fmt.Fprintln(...) instead of Write([]byte(fmt.Sprintln(...))) (staticcheck) errStream.Write([]byte(fmt.Sprintln(i18n.Tr("Cannot perform port reset: %s", err)))) ^ commands/service_upload.go:731:3: QF1012: Use fmt.Fprintln(...) instead of Write([]byte(fmt.Sprintln(...))) (staticcheck) outStream.Write([]byte(fmt.Sprintln(cmdLine))) ^
1 parent 2709c00 commit 48ede6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

commands/service_upload.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,9 @@ func (s *arduinoCoreServerImpl) runProgramAction(ctx context.Context, pme *packa
529529
}
530530
if verbose {
531531
if portAddress != "" {
532-
outStream.Write([]byte(fmt.Sprintln(i18n.Tr("Upload port found on %s", portAddress))))
532+
fmt.Fprintln(outStream, i18n.Tr("Upload port found on %s", portAddress))
533533
} else {
534-
outStream.Write([]byte(fmt.Sprintln(i18n.Tr("No upload port found, using %s as fallback", actualPort.Address))))
534+
fmt.Fprintln(outStream, i18n.Tr("No upload port found, using %s as fallback", actualPort.Address))
535535
}
536536
}
537537
},
@@ -541,7 +541,7 @@ func (s *arduinoCoreServerImpl) runProgramAction(ctx context.Context, pme *packa
541541
}
542542

543543
if newPortAddress, err := serialutils.Reset(portToTouch, wait, dryRun, nil, cb); err != nil {
544-
errStream.Write([]byte(fmt.Sprintln(i18n.Tr("Cannot perform port reset: %s", err))))
544+
fmt.Fprintln(errStream, i18n.Tr("Cannot perform port reset: %s", err))
545545
} else {
546546
if newPortAddress != "" {
547547
actualPort.Address = newPortAddress
@@ -728,7 +728,7 @@ func runTool(ctx context.Context, recipeID string, props *properties.Map, outStr
728728
// Run Tool
729729
logrus.WithField("phase", "upload").Tracef("Executing upload tool: %s", cmdLine)
730730
if verbose {
731-
outStream.Write([]byte(fmt.Sprintln(cmdLine)))
731+
fmt.Fprintln(outStream, cmdLine)
732732
}
733733
if dryRun {
734734
return nil

0 commit comments

Comments
 (0)