mirror of
https://github.com/containers/image.git
synced 2025-04-18 19:44:05 +03:00
Fix "QF1012: Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...))"
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
ccf60336a2
commit
6b189934ad
@ -1048,14 +1048,10 @@ func TestSetGetCredentials(t *testing.T) {
|
||||
sys := &types.SystemContext{}
|
||||
if tc.useLegacyFormat {
|
||||
sys.LegacyFormatAuthFilePath = tmpFile.Name()
|
||||
_, err = tmpFile.WriteString(fmt.Sprintf(
|
||||
`{"%s":{"auth":"dXNlcm5hbWU6cGFzc3dvcmQ="}}`, tc.set,
|
||||
))
|
||||
_, err = fmt.Fprintf(tmpFile, `{"%s":{"auth":"dXNlcm5hbWU6cGFzc3dvcmQ="}}`, tc.set)
|
||||
} else {
|
||||
sys.AuthFilePath = tmpFile.Name()
|
||||
_, err = tmpFile.WriteString(fmt.Sprintf(
|
||||
`{"auths":{"%s":{"auth":"dXNlcm5hbWU6cGFzc3dvcmQ="}}}`, tc.set,
|
||||
))
|
||||
_, err = fmt.Fprintf(tmpFile, `{"auths":{"%s":{"auth":"dXNlcm5hbWU6cGFzc3dvcmQ="}}}`, tc.set)
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user