mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-04-05 21:15:00 +00:00
[no-relnote] Fix QF1012: Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)) lint errors
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
80fb4dc0e9
commit
3913a6392b
@ -199,7 +199,7 @@ func (m command) createLdsoconfdFile(in containerRoot, pattern string, dirs ...s
|
||||
if added[dir] {
|
||||
continue
|
||||
}
|
||||
_, err = configFile.WriteString(fmt.Sprintf("%s\n", dir))
|
||||
_, err = fmt.Fprintf(configFile, "%s\n", dir)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update config file: %w", err)
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ func (m command) createLdsoconfdFile(in containerRoot, pattern string, dirs ...s
|
||||
if added[dir] {
|
||||
continue
|
||||
}
|
||||
_, err = configFile.WriteString(fmt.Sprintf("%s\n", dir))
|
||||
_, err = fmt.Fprintf(configFile, "%s\n", dir)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update config file: %w", err)
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ func TestGetHookConfig(t *testing.T) {
|
||||
configflag = &filename
|
||||
|
||||
for _, line := range tc.lines {
|
||||
_, err := configFile.WriteString(fmt.Sprintf("%s\n", line))
|
||||
_, err := fmt.Fprintf(configFile, "%s\n", line)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ func (a *app) initialize(pidFile string) error {
|
||||
return fmt.Errorf("unable to get flock on pidfile: %v", err)
|
||||
}
|
||||
|
||||
_, err = f.WriteString(fmt.Sprintf("%v\n", os.Getpid()))
|
||||
_, err = fmt.Fprintf(f, "%v\n", os.Getpid())
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to write PID to pidfile: %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user