mirror of
https://github.com/containers/podman.git
synced 2025-10-13 01:06:10 +08:00
Fix QF1012 staticcheck warnings
> QF1012: Use fmt.Fprintf(...) instead of WriteString Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@ -291,7 +291,7 @@ func StartGenericAppleVM(mc *vmconfigs.MachineConfig, cmdBinary string, bootload
|
|||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
for _, arg := range cmd.Args {
|
for _, arg := range cmd.Args {
|
||||||
_, err = f.WriteString(fmt.Sprintf("%q ", arg))
|
_, err = fmt.Fprintf(f, "%q ", arg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -483,7 +483,7 @@ func escapeString(escaped *strings.Builder, word string, isPath bool) {
|
|||||||
escaped.WriteString("-")
|
escaped.WriteString("-")
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
escaped.WriteString(fmt.Sprintf("\\x%.2x", c))
|
fmt.Fprintf(escaped, "\\x%.2x", c)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
escaped.WriteRune(c)
|
escaped.WriteRune(c)
|
||||||
|
@ -575,7 +575,7 @@ func (p *PodmanTestIntegration) StopPod(nameOrID string) {
|
|||||||
|
|
||||||
func processTestResult(r SpecReport) {
|
func processTestResult(r SpecReport) {
|
||||||
tr := testResult{length: r.RunTime.Seconds(), name: r.FullText()}
|
tr := testResult{length: r.RunTime.Seconds(), name: r.FullText()}
|
||||||
_, err := timingsFile.WriteString(fmt.Sprintf("%s\t\t%f\n", tr.name, tr.length))
|
_, err := fmt.Fprintf(timingsFile, "%s\t\t%f\n", tr.name, tr.length)
|
||||||
Expect(err).ToNot(HaveOccurred(), "write timings")
|
Expect(err).ToNot(HaveOccurred(), "write timings")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user