Skip to content

Commit dcb08f1

Browse files
authored
Merge pull request #1928 from shirou/feat/fix_lint_on_disk_linux
[disk][linux]: fix lint (gofumpt)
2 parents 37bceae + a215163 commit dcb08f1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

disk/disk_linux.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,18 @@ func readMountFile(root string) (lines []string, useMounts bool, filename string
244244
if err != nil {
245245
var pathErr *os.PathError
246246
if !errors.As(err, &pathErr) {
247-
return
247+
return lines, useMounts, filename, err
248248
}
249249
// if kernel does not support 1/mountinfo, fallback to 1/mounts (<2.6.26)
250250
useMounts = true
251251
filename = path.Join(root, "mounts")
252252
lines, err = common.ReadLines(filename)
253253
if err != nil {
254-
return
254+
return lines, useMounts, filename, err
255255
}
256-
return
256+
return lines, useMounts, filename, err
257257
}
258-
return
258+
return lines, useMounts, filename, err
259259
}
260260

261261
func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, error) {

net/net_windows.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func getTableInfo(filename string, table any) (index, step, length int) {
348348
length = int(table.(pmibUDP6TableOwnerPid).DwNumEntries)
349349
}
350350

351-
return
351+
return index, step, length
352352
}
353353

354354
func getTCPConnections(family uint32) ([]ConnectionStat, error) {
@@ -533,15 +533,15 @@ func getExtendedTCPTable(pTCPTable uintptr, pdwSize *uint32, bOrder bool, ulAf u
533533
if r1 != 0 {
534534
errcode = syscall.Errno(r1)
535535
}
536-
return
536+
return errcode
537537
}
538538

539539
func getExtendedUDPTable(pUDPTable uintptr, pdwSize *uint32, bOrder bool, ulAf uint32, tableClass udpTableClass, reserved uint32) (errcode error) {
540540
r1, _, _ := syscall.Syscall6(procGetExtendedUDPTable.Addr(), 6, pUDPTable, uintptr(unsafe.Pointer(pdwSize)), getUintptrFromBool(bOrder), uintptr(ulAf), uintptr(tableClass), uintptr(reserved))
541541
if r1 != 0 {
542542
errcode = syscall.Errno(r1)
543543
}
544-
return
544+
return errcode
545545
}
546546

547547
func getUintptrFromBool(b bool) uintptr {

process/process_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ func getProcessMemoryInfo(h windows.Handle, mem *PROCESS_MEMORY_COUNTERS) (err e
956956
err = syscall.EINVAL
957957
}
958958
}
959-
return
959+
return err
960960
}
961961

962962
type SYSTEM_TIMES struct { //nolint:revive //FIXME

0 commit comments

Comments
 (0)