daemon/graphdriver: use strconv instead of fmt.Sprintf

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-10-05 16:24:46 +02:00
parent c218211012
commit 7fbf321c2a
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
4 changed files with 8 additions and 6 deletions

View File

@ -32,6 +32,7 @@ import (
"os/exec"
"path"
"path/filepath"
"strconv"
"strings"
"sync"
@ -209,8 +210,8 @@ func (a *Driver) Status() [][2]string {
return [][2]string{
{"Root Dir", a.rootPath()},
{"Backing Filesystem", backingFs},
{"Dirs", fmt.Sprintf("%d", len(ids))},
{"Dirperm1 Supported", fmt.Sprintf("%v", useDirperm())},
{"Dirs", strconv.Itoa(len(ids))},
{"Dirperm1 Supported", strconv.FormatBool(useDirperm())},
}
}

View File

@ -10,6 +10,7 @@ import (
"os"
"path"
"path/filepath"
"strconv"
"sync"
"testing"
@ -651,8 +652,8 @@ func testMountMoreThan42Layers(t *testing.T, mountPath string) {
for i := 1; i < 127; i++ {
expected++
var (
parent = fmt.Sprintf("%d", i-1)
current = fmt.Sprintf("%d", i)
parent = strconv.Itoa(i - 1)
current = strconv.Itoa(i)
)
if parent == "0" {

View File

@ -156,7 +156,7 @@ func (d *Driver) Status() [][2]string {
status = append(status, [2]string{"Build Version", bv})
}
if lv := btrfsLibVersion(); lv != -1 {
status = append(status, [2]string{"Library Version", fmt.Sprintf("%d", lv)})
status = append(status, [2]string{"Library Version", strconv.Itoa(lv)})
}
return status
}

View File

@ -231,7 +231,7 @@ func (d *Driver) GetMetadata(id string) (map[string]string, error) {
}
func (d *Driver) cloneFilesystem(name, parentName string) error {
snapshotName := fmt.Sprintf("%d", time.Now().Nanosecond())
snapshotName := strconv.Itoa(time.Now().Nanosecond())
parentDataset := zfs.Dataset{Name: parentName}
snapshot, err := parentDataset.Snapshot(snapshotName /*recursive */, false)
if err != nil {