daemon/graphdriver: use strconv instead of fmt.Sprintf
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7fbf321c2a
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
8f5bbc24ef
commit
01883e1177
4 changed files with 8 additions and 6 deletions
|
@ -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())},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
|
@ -659,8 +660,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" {
|
||||
|
|
|
@ -159,7 +159,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
|
||||
}
|
||||
|
|
|
@ -232,7 +232,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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue