run gofumpt cleanup across code-base (#14015)

This commit is contained in:
Harshavardhana
2022-01-02 09:15:06 -08:00
committed by GitHub
parent 6f474982ed
commit f527c708f2
250 changed files with 1201 additions and 1264 deletions

View File

@@ -30,10 +30,9 @@ import (
// GetHealthInfo about the drive
func GetHealthInfo(ctx context.Context, drive, fsPath string) (madmin.DiskLatency, madmin.DiskThroughput, error) {
// Create a file with O_DIRECT flag, choose default umask and also make sure
// we are exclusively writing to a new file using O_EXCL.
w, err := OpenFileDirectIO(fsPath, os.O_CREATE|os.O_WRONLY|os.O_EXCL, 0666)
w, err := OpenFileDirectIO(fsPath, os.O_CREATE|os.O_WRONLY|os.O_EXCL, 0o666)
if err != nil {
return madmin.DiskLatency{}, madmin.DiskThroughput{}, err
}

View File

@@ -26,10 +26,8 @@ import (
"unsafe"
)
var (
// GetVolumeInformation provides windows drive volume information.
GetVolumeInformation = kernel32.NewProc("GetVolumeInformationW")
)
// GetVolumeInformation provides windows drive volume information.
var GetVolumeInformation = kernel32.NewProc("GetVolumeInformationW")
// getFSType returns the filesystem type of the underlying mounted filesystem
func getFSType(path string) string {
@@ -37,7 +35,7 @@ func getFSType(path string) string {
var lpVolumeSerialNumber uint32
var lpFileSystemFlags, lpMaximumComponentLength uint32
var lpFileSystemNameBuffer, volumeName [260]uint16
var ps = syscall.StringToUTF16Ptr(filepath.VolumeName(path))
ps := syscall.StringToUTF16Ptr(filepath.VolumeName(path))
// Extract values safely
// BOOL WINAPI GetVolumeInformation(