Переглянути джерело

daemon/graphdriver: normalize comment formatting

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 роки тому
батько
коміт
ec4bc83258

+ 1 - 1
daemon/graphdriver/btrfs/btrfs.go

@@ -134,7 +134,7 @@ func parseOptions(opt []string) (btrfsOptions, bool, error) {
 
 
 // Driver contains information about the filesystem mounted.
 // Driver contains information about the filesystem mounted.
 type Driver struct {
 type Driver struct {
-	//root of the file system
+	// root of the file system
 	home         string
 	home         string
 	uidMaps      []idtools.IDMap
 	uidMaps      []idtools.IDMap
 	gidMaps      []idtools.IDMap
 	gidMaps      []idtools.IDMap

+ 1 - 1
daemon/graphdriver/copy/copy.go

@@ -143,7 +143,7 @@ func DirCopy(srcDir, dstDir string, copyMode Mode, copyXattrs bool) error {
 
 
 		switch mode := f.Mode(); {
 		switch mode := f.Mode(); {
 		case mode.IsRegular():
 		case mode.IsRegular():
-			//the type is 32bit on mips
+			// the type is 32bit on mips
 			id := fileID{dev: uint64(stat.Dev), ino: stat.Ino} // nolint: unconvert
 			id := fileID{dev: uint64(stat.Dev), ino: stat.Ino} // nolint: unconvert
 			if copyMode == Hardlink {
 			if copyMode == Hardlink {
 				isHardlink = true
 				isHardlink = true

+ 1 - 2
daemon/graphdriver/copy/copy_test.go

@@ -67,8 +67,7 @@ func TestCopyDir(t *testing.T) {
 		if srcFileSys.Dev == dstFileSys.Dev {
 		if srcFileSys.Dev == dstFileSys.Dev {
 			assert.Check(t, srcFileSys.Ino != dstFileSys.Ino)
 			assert.Check(t, srcFileSys.Ino != dstFileSys.Ino)
 		}
 		}
-		// Todo: check size, and ctim is not equal
-		/// on filesystems that have granular ctimes
+		// Todo: check size, and ctim is not equal on filesystems that have granular ctimes
 		assert.Check(t, is.DeepEqual(srcFileSys.Mode, dstFileSys.Mode))
 		assert.Check(t, is.DeepEqual(srcFileSys.Mode, dstFileSys.Mode))
 		assert.Check(t, is.DeepEqual(srcFileSys.Uid, dstFileSys.Uid))
 		assert.Check(t, is.DeepEqual(srcFileSys.Uid, dstFileSys.Uid))
 		assert.Check(t, is.DeepEqual(srcFileSys.Gid, dstFileSys.Gid))
 		assert.Check(t, is.DeepEqual(srcFileSys.Gid, dstFileSys.Gid))

+ 3 - 3
daemon/graphdriver/devmapper/deviceset.go

@@ -119,7 +119,7 @@ type DeviceSet struct {
 	deletionWorkerTicker  *time.Ticker
 	deletionWorkerTicker  *time.Ticker
 	uidMaps               []idtools.IDMap
 	uidMaps               []idtools.IDMap
 	gidMaps               []idtools.IDMap
 	gidMaps               []idtools.IDMap
-	minFreeSpacePercent   uint32 //min free space percentage in thinpool
+	minFreeSpacePercent   uint32 // min free space percentage in thinpool
 	xfsNospaceRetries     string // max retries when xfs receives ENOSPC
 	xfsNospaceRetries     string // max retries when xfs receives ENOSPC
 	lvmSetupConfig        directLVMConfig
 	lvmSetupConfig        directLVMConfig
 }
 }
@@ -1692,8 +1692,8 @@ func (devices *DeviceSet) initDevmapper(doInit bool) (retErr error) {
 		}
 		}
 	}
 	}
 
 
-	//create the root dir of the devmapper driver ownership to match this
-	//daemon's remapped root uid/gid so containers can start properly
+	// create the root dir of the devmapper driver ownership to match this
+	// daemon's remapped root uid/gid so containers can start properly
 	uid, gid, err := idtools.GetRootUIDGID(devices.uidMaps, devices.gidMaps)
 	uid, gid, err := idtools.GetRootUIDGID(devices.uidMaps, devices.gidMaps)
 	if err != nil {
 	if err != nil {
 		return err
 		return err

+ 1 - 1
daemon/graphdriver/devmapper/devmapper_test.go

@@ -110,7 +110,7 @@ func testChangeLoopBackSize(t *testing.T, delta, expectDataSize, expectMetaDataS
 	if err := driver.Cleanup(); err != nil {
 	if err := driver.Cleanup(); err != nil {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
-	//Reload
+	// Reload
 	d, err := Init(driver.home, []string{
 	d, err := Init(driver.home, []string{
 		fmt.Sprintf("dm.loopdatasize=%d", defaultDataLoopbackSize+delta),
 		fmt.Sprintf("dm.loopdatasize=%d", defaultDataLoopbackSize+delta),
 		fmt.Sprintf("dm.loopmetadatasize=%d", defaultMetaDataLoopbackSize+delta),
 		fmt.Sprintf("dm.loopmetadatasize=%d", defaultMetaDataLoopbackSize+delta),

+ 1 - 1
daemon/graphdriver/driver.go

@@ -29,7 +29,7 @@ var (
 	drivers map[string]InitFunc
 	drivers map[string]InitFunc
 )
 )
 
 
-//CreateOpts contains optional arguments for Create() and CreateReadWrite()
+// CreateOpts contains optional arguments for Create() and CreateReadWrite()
 // methods.
 // methods.
 type CreateOpts struct {
 type CreateOpts struct {
 	MountLabel string
 	MountLabel string

+ 1 - 1
daemon/graphdriver/overlay2/mount.go

@@ -53,7 +53,7 @@ func mountFrom(dir, device, target, mType string, flags uintptr, label string) e
 		w.Close()
 		w.Close()
 		return fmt.Errorf("mountfrom error on re-exec cmd: %v", err)
 		return fmt.Errorf("mountfrom error on re-exec cmd: %v", err)
 	}
 	}
-	//write the options to the pipe for the untar exec to read
+	// write the options to the pipe for the untar exec to read
 	if err := json.NewEncoder(w).Encode(options); err != nil {
 	if err := json.NewEncoder(w).Encode(options); err != nil {
 		w.Close()
 		w.Close()
 		return fmt.Errorf("mountfrom json encode to pipe failed: %v", err)
 		return fmt.Errorf("mountfrom json encode to pipe failed: %v", err)