Преглед на файлове

daemon/graphdriver: fix empty-lines (revive)

    daemon/graphdriver/aufs/aufs.go:239:80: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/graphtest/graphbench_unix.go:249:27: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/graphtest/testutil.go:271:30: empty-lines: extra empty line at the end of a block (revive)
    daemon/graphdriver/graphtest/graphbench_unix.go:179:32: empty-block: this block is empty, you can remove it (revive)
    daemon/graphdriver/zfs/zfs.go:375:48: empty-lines: extra empty line at the end of a block (revive)
    daemon/graphdriver/overlay/overlay.go:248:89: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:636:21: empty-lines: extra empty line at the end of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:1150:70: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:1613:30: empty-lines: extra empty line at the end of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:1645:65: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/btrfs/btrfs.go:53:101: empty-lines: extra empty line at the start of a block (revive)
    daemon/graphdriver/devmapper/deviceset.go:1944:89: empty-lines: extra empty line at the start of a block (revive)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn преди 2 години
родител
ревизия
9d9cca49b4

+ 0 - 1
daemon/graphdriver/aufs/aufs.go

@@ -237,7 +237,6 @@ func (a *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts
 // Create three folders for each id
 // mnt, layers, and diff
 func (a *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error {
-
 	if opts != nil && len(opts.StorageOpt) != 0 {
 		return fmt.Errorf("--storage-opt is not supported for aufs")
 	}

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

@@ -51,7 +51,6 @@ type btrfsOptions struct {
 // Init returns a new BTRFS driver.
 // An error is returned if BTRFS is not supported.
 func Init(home string, options []string, idMap idtools.IdentityMapping) (graphdriver.Driver, error) {
-
 	// Perform feature detection on /var/lib/docker/btrfs if it's an existing directory.
 	// This covers situations where /var/lib/docker/btrfs is a mount, and on a different
 	// filesystem than /var/lib/docker.

+ 0 - 5
daemon/graphdriver/devmapper/deviceset.go

@@ -647,7 +647,6 @@ func (devices *DeviceSet) migrateOldMetaData() error {
 		if err := os.Rename(devices.oldMetadataFile(), devices.oldMetadataFile()+".migrated"); err != nil {
 			return err
 		}
-
 	}
 
 	return nil
@@ -1148,7 +1147,6 @@ func (devices *DeviceSet) setupVerifyBaseImageUUIDFS(baseInfo *devInfo) error {
 }
 
 func (devices *DeviceSet) checkGrowBaseDeviceFS(info *devInfo) error {
-
 	if !userBaseSize {
 		return nil
 	}
@@ -1622,7 +1620,6 @@ func (devices *DeviceSet) loadThinPoolLoopBackInfo() error {
 			devices.dataDevice = dataLoopDevice
 			devices.dataLoopFile = datafilename
 		}
-
 	}
 
 	// metadata device has not been passed in. So there should be a
@@ -1643,7 +1640,6 @@ func (devices *DeviceSet) loadThinPoolLoopBackInfo() error {
 }
 
 func (devices *DeviceSet) enableDeferredRemovalDeletion() error {
-
 	// If user asked for deferred removal then check both libdm library
 	// and kernel driver support deferred removal otherwise error out.
 	if enableDeferredRemoval {
@@ -1946,7 +1942,6 @@ func (devices *DeviceSet) AddDevice(hash, baseHash string, storageOpt map[string
 }
 
 func (devices *DeviceSet) parseStorageOpt(storageOpt map[string]string) (uint64, error) {
-
 	// Read size to change the block device size per container.
 	for key, val := range storageOpt {
 		key := strings.ToLower(key)

+ 2 - 3
daemon/graphdriver/graphtest/graphbench_unix.go

@@ -176,10 +176,10 @@ func DriverBenchDiffApplyN(b *testing.B, fileCount int, drivername string, drive
 		// suppressing "SA9003: empty branch (staticcheck)" instead of commenting-out/removing
 		// these lines because removing/commenting these lines causes a ripple effect
 		// of changes, and there's still a to-do below
-		//nolint:staticcheck
+		//nolint:staticcheck,revive
 		if applyDiffSize != diffSize {
 			// TODO: enforce this
-			//b.Fatalf("Apply diff size different, got %d, expected %s", applyDiffSize, diffSize)
+			// b.Fatalf("Apply diff size different, got %d, expected %s", applyDiffSize, diffSize)
 		}
 		if err := checkManyFiles(driver, diff, fileCount, 6); err != nil {
 			b.Fatal(err)
@@ -248,7 +248,6 @@ func DriverBenchDeepLayerRead(b *testing.B, layerCount int, drivername string, d
 
 	b.ResetTimer()
 	for i := 0; i < b.N; i++ {
-
 		// Read content
 		c, err := os.ReadFile(filepath.Join(root, "testfile.txt"))
 		if err != nil {

+ 0 - 1
daemon/graphdriver/graphtest/testutil.go

@@ -279,7 +279,6 @@ func addManyLayers(drv graphdriver.Driver, baseLayer string, count int) (string,
 		}
 
 		lastLayer = nextLayer
-
 	}
 	return lastLayer, nil
 }

+ 0 - 1
daemon/graphdriver/overlay/overlay.go

@@ -246,7 +246,6 @@ func (d *Driver) CreateReadWrite(id, parent string, opts *graphdriver.CreateOpts
 // Create is used to create the upper, lower, and merge directories required for overlay fs for a given id.
 // The parent filesystem is used to configure these directories for the overlay.
 func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) (retErr error) {
-
 	if opts != nil && len(opts.StorageOpt) != 0 {
 		return fmt.Errorf("--storage-opt is not supported for overlay")
 	}

+ 0 - 1
daemon/graphdriver/zfs/zfs.go

@@ -378,7 +378,6 @@ func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
 				if rmErr := unix.Rmdir(mountpoint); rmErr != nil && !os.IsNotExist(rmErr) {
 					logrus.WithField("storage-driver", "zfs").Debugf("Failed to remove %s: %v", id, rmErr)
 				}
-
 			}
 		}
 	}()