Skip to content

Commit

Permalink
lxc/storage_volume: avoid fmt.Sprintf()
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Feb 14, 2025
1 parent 3a31e10 commit c74a956
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lxc/storage_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,7 @@ func (c *cmdStorageVolumeList) poolColumnData(vol api.StorageVolume, state api.S

func (c *cmdStorageVolumeList) typeColumnData(vol api.StorageVolume, state api.StorageVolumeState) string {
if shared.IsSnapshot(vol.Name) {
return fmt.Sprintf("%s (snapshot)", vol.Type)
return vol.Type + " (snapshot)"
}

return vol.Type
Expand Down Expand Up @@ -1954,7 +1954,7 @@ func (c *cmdStorageVolumeMove) run(cmd *cobra.Command, args []string) error {
var args []string

if srcRemote != "" {
args = append(args, fmt.Sprintf("%s:%s", srcRemote, srcVolPool))
args = append(args, srcRemote+":"+srcVolPool)
} else {
args = append(args, srcVolPool)
}
Expand Down Expand Up @@ -2922,7 +2922,7 @@ func (c *cmdStorageVolumeImport) run(cmd *cobra.Command, args []string) error {
Tracker: &ioprogress.ProgressTracker{
Length: fstat.Size(),
Handler: func(percent int64, speed int64) {
progress.UpdateProgress(ioprogress.ProgressData{Text: fmt.Sprintf("%d%% (%s/s)", percent, units.GetByteSizeString(speed, 2))})
progress.UpdateProgress(ioprogress.ProgressData{Text: strconv.FormatInt(percent, 10) + "% (" + units.GetByteSizeString(speed, 2) + "/s)"})
},
},
},
Expand Down

0 comments on commit c74a956

Please sign in to comment.