Skip to content

Commit 1081e04

Browse files
committed
Add godoc comments and fix linter warnings
1 parent c834706 commit 1081e04

File tree

7 files changed

+19
-2
lines changed

7 files changed

+19
-2
lines changed

filesystems_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package main
55

66
import "strings"
77

8+
//nolint:revive,deadcode
89
const (
910
// man statfs
1011
ADFS_SUPER_MAGIC = 0xadf5
@@ -210,6 +211,7 @@ var fsTypeMap = map[int64]string{
210211
ZFS_SUPER_MAGIC: "zfs", /* 0x2FC12FC1 local */
211212
}
212213

214+
/*
213215
var localMap = map[int64]bool{
214216
AFS_SUPER_MAGIC: true,
215217
BTRFS_SUPER_MAGIC: true,
@@ -225,6 +227,7 @@ var localMap = map[int64]bool{
225227
XFS_SUPER_MAGIC: true,
226228
ZFS_SUPER_MAGIC: true,
227229
}
230+
*/
228231

229232
var networkMap = map[int64]bool{
230233
CIFS_MAGIC_NUMBER: true,
@@ -254,9 +257,11 @@ var specialMap = map[int64]bool{
254257
TRACEFS_MAGIC: true,
255258
}
256259

260+
/*
257261
func isLocalFs(m Mount) bool {
258262
return localMap[int64(m.Stat().Type)] //nolint:unconvert
259263
}
264+
*/
260265

261266
func isFuseFs(m Mount) bool {
262267
return m.Stat().Type == FUSEBLK_SUPER_MAGIC ||

groups.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const (
1313
bindsMount = "binds"
1414
)
1515

16+
// FilterOptions contains all filters.
1617
type FilterOptions struct {
1718
HiddenDevices map[string]struct{}
1819
OnlyDevices map[string]struct{}

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ import (
1515
)
1616

1717
var (
18-
Version = ""
18+
// Version contains the application version number. It's set via ldflags
19+
// when building.
20+
Version = ""
21+
22+
// CommitSHA contains the SHA of the commit that this application was built
23+
// against. It's set via ldflags when building.
1924
CommitSHA = ""
2025

2126
env = termenv.EnvColorProfile()

mounts.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func readLines(filename string) ([]string, error) {
3030
if err != nil {
3131
return nil, err
3232
}
33-
defer file.Close()
33+
defer file.Close() //nolint:errcheck // ignore error
3434

3535
scanner := bufio.NewScanner(file)
3636
var s []string
@@ -49,6 +49,7 @@ func unescapeFstab(path string) string {
4949
return escaped
5050
}
5151

52+
//nolint:deadcode,unused // used on BSD
5253
func byteToString(orig []byte) string {
5354
n := -1
5455
l := -1
@@ -72,6 +73,7 @@ func byteToString(orig []byte) string {
7273
return string(orig[l:n])
7374
}
7475

76+
//nolint:deadcode,unused // used on OpenBSD
7577
func intToString(orig []int8) string {
7678
ret := make([]byte, len(orig))
7779
size := -1

mounts_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const (
4242
//mountinfoSuperOptions = 10
4343
)
4444

45+
// Stat returns the mountpoint's stat information.
4546
func (m *Mount) Stat() unix.Statfs_t {
4647
return m.Metadata.(unix.Statfs_t)
4748
}

table.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ import (
1212
"github.com/muesli/termenv"
1313
)
1414

15+
// TableOptions contains all options for the table.
1516
type TableOptions struct {
1617
Columns []int
1718
SortBy int
1819
Style table.Style
1920
}
2021

22+
// Column defines a column.
2123
type Column struct {
2224
ID string
2325
Name string

themes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/muesli/termenv"
77
)
88

9+
// Theme defines a color theme used for printing tables.
910
type Theme struct {
1011
colorRed termenv.Color
1112
colorYellow termenv.Color

0 commit comments

Comments
 (0)