Skip to content

Commit

Permalink
Fix linting issue (#37)
Browse files Browse the repository at this point in the history
* fix linting issue

* small fix

* update CODEOWNER
  • Loading branch information
xuluna authored Dec 18, 2023
1 parent a1e7bab commit 1aacd4a
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 168 deletions.
7 changes: 6 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
# Pooja Prasannakumar (kumarp20)
# Prsanna Muthukumaraswamy (prablr79)
# Trevor Dawe (tdawe)
# Luna Xu (xuluna)
# Peres Kereotubo (PeresKereotubo)
# Emily Kinuthia (EmilyKatdell)
# Kerry Kovacevic (KerryKovacevic)
# Evgeny Uglov (EvgenyUglov)


# for all files:
* @kumarp20 @bpjain2004 @francis-nijay @harishp8889 @prablr79 @hoppea2 @tdawe @coulof @shaynafinocchiaro @sharmilarama @isaiasA1 @arnchiequ-dell @alikdell @atye @adamginna-dell @cbartoszDell @bogdanNovikovDell @Leonard-Dell @mareksuski-dell @mdutka-dell
* @kumarp20 @bpjain2004 @francis-nijay @harishp8889 @prablr79 @hoppea2 @tdawe @coulof @shaynafinocchiaro @sharmilarama @xuluna @PeresKereotubo @alikdell @atye @adamginna-dell @cbartoszDell @bogdanNovikovDell @Leonard-Dell @mareksuski-dell @mdutka-dell @EmilyKatdell @KerryKovacevic @EvgenyUglov
33 changes: 17 additions & 16 deletions gofsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ type FSinterface interface {
FsInfo(ctx context.Context, path string) (int64, int64, int64, int64, int64, int64, error)
}

var (
// MultipathDevDiskByIDPrefix is a pathname prefix for items located in /dev/disk/by-id
MultipathDevDiskByIDPrefix = "/dev/disk/by-id/dm-uuid-mpath-3"
)
// MultipathDevDiskByIDPrefix is a pathname prefix for items located in /dev/disk/by-id
var MultipathDevDiskByIDPrefix = "/dev/disk/by-id/dm-uuid-mpath-3"

var (
// ErrNotImplemented is returned when a platform does not implement
Expand Down Expand Up @@ -111,17 +109,17 @@ func GetDiskFormat(ctx context.Context, disk string) (string, error) {
func FormatAndMount(
ctx context.Context,
source, target, fsType string,
opts ...string) error {

opts ...string,
) error {
return fs.FormatAndMount(ctx, source, target, fsType, opts...)
}

// Format uses unix utils to format the given disk.
func Format(
ctx context.Context,
source, target, fsType string,
opts ...string) error {

opts ...string,
) error {
return fs.Format(ctx, source, target, fsType, opts...)
}

Expand All @@ -137,8 +135,8 @@ func Format(
func Mount(
ctx context.Context,
source, target, fsType string,
opts ...string) error {

opts ...string,
) error {
return fs.Mount(ctx, source, target, fsType, opts...)
}

Expand All @@ -147,8 +145,8 @@ func Mount(
func BindMount(
ctx context.Context,
source, target string,
opts ...string) error {

opts ...string,
) error {
return fs.BindMount(ctx, source, target, opts...)
}

Expand All @@ -171,7 +169,8 @@ func GetMpathNameFromDevice(ctx context.Context, device string) (string, error)
func ResizeFS(
ctx context.Context,
volumePath, devicePath, ppathDevice,
mpathDevice, fsType string) error {
mpathDevice, fsType string,
) error {
return fs.resizeFS(ctx, volumePath, devicePath, ppathDevice, mpathDevice, fsType)
}

Expand All @@ -182,13 +181,15 @@ func ResizeMultipath(ctx context.Context, deviceName string) error {

// FindFSType fetches the filesystem type on mountpoint
func FindFSType(
ctx context.Context, mountpoint string) (fsType string, err error) {
ctx context.Context, mountpoint string,
) (fsType string, err error) {
return fs.findFSType(ctx, mountpoint)
}

// DeviceRescan rescan the device for size alterations
func DeviceRescan(ctx context.Context,
devicePath string) error {
devicePath string,
) error {
return fs.deviceRescan(ctx, devicePath)
}

Expand Down Expand Up @@ -217,7 +218,7 @@ func GetDevMounts(ctx context.Context, dev string) ([]Info, error) {
// EvalSymlinks evaluates the provided path and updates it to remove
// any symlinks in its structure, replacing them with the actual path
// components.
func EvalSymlinks(ctx context.Context, symPath *string) error {
func EvalSymlinks(_ context.Context, symPath *string) error {
realPath, err := filepath.EvalSymlinks(*symPath)
if err != nil {
return err
Expand Down
32 changes: 17 additions & 15 deletions gofsutil_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (

// FS provides many filesystem-specific functions, such as mount, format, etc.
type FS struct {

// ScanEntry is the function used to process mount table entries.
ScanEntry EntryScanFunc
}
Expand All @@ -35,17 +34,17 @@ func (fs *FS) GetDiskFormat(ctx context.Context, disk string) (string, error) {
func (fs *FS) FormatAndMount(
ctx context.Context,
source, target, fsType string,
options ...string) error {

options ...string,
) error {
return fs.formatAndMount(ctx, source, target, fsType, options...)
}

// Format uses unix utils to format the given disk.
func (fs *FS) Format(
ctx context.Context,
source, target, fsType string,
options ...string) error {

options ...string,
) error {
return fs.format(ctx, source, target, fsType, options...)
}

Expand All @@ -61,8 +60,8 @@ func (fs *FS) Format(
func (fs *FS) Mount(
ctx context.Context,
source, target, fsType string,
options ...string) error {

options ...string,
) error {
return fs.mount(ctx, source, target, fsType, options...)
}

Expand All @@ -71,8 +70,8 @@ func (fs *FS) Mount(
func (fs *FS) BindMount(
ctx context.Context,
source, target string,
options ...string) error {

options ...string,
) error {
if options == nil {
options = []string{"bind"}
} else {
Expand Down Expand Up @@ -100,13 +99,15 @@ func (fs *FS) GetMpathNameFromDevice(ctx context.Context, device string) (string
func (fs *FS) ResizeFS(
ctx context.Context,
volumePath, devicePath, ppathDevice,
mpathDevice, fsType string) error {
mpathDevice, fsType string,
) error {
return fs.resizeFS(ctx, volumePath, devicePath, ppathDevice, mpathDevice, fsType)
}

// FindFSType fetches the filesystem type on mountpoint
func (fs *FS) FindFSType(
ctx context.Context, mountpoint string) (fsType string, err error) {
ctx context.Context, mountpoint string,
) (fsType string, err error) {
return fs.findFSType(ctx, mountpoint)
}

Expand All @@ -117,7 +118,8 @@ func (fs *FS) ResizeMultipath(ctx context.Context, deviceName string) error {

// DeviceRescan rescan the device for size alterations
func (fs *FS) DeviceRescan(ctx context.Context,
devicePath string) error {
devicePath string,
) error {
return fs.deviceRescan(ctx, devicePath)
}

Expand Down Expand Up @@ -148,8 +150,8 @@ func (fs *FS) GetDevMounts(ctx context.Context, dev string) ([]Info, error) {
// evaluated and returned as an absolute path without any symlinks.
// Otherwise an empty string is returned.
func (fs *FS) ValidateDevice(
ctx context.Context, source string) (string, error) {

ctx context.Context, source string,
) (string, error) {
return fs.validateDevice(ctx, source)
}

Expand Down Expand Up @@ -182,7 +184,7 @@ func (fs *FS) MultipathCommand(ctx context.Context, timeoutSeconds time.Duration

// fsInfo linux returns (available bytes, byte capacity, byte usage, total inodes, inodes free, inode usage, error)
// for the filesystem that path resides upon.
func (fs *FS) fsInfo(ctx context.Context, path string) (int64, int64, int64, int64, int64, int64, error) {
func (fs *FS) fsInfo(_ context.Context, path string) (int64, int64, int64, int64, int64, int64, error) {
statfs := &unix.Statfs_t{}
err := unix.Statfs(path, statfs)
if err != nil {
Expand Down
Loading

0 comments on commit 1aacd4a

Please sign in to comment.