From ad7461a5435ef0a9d6b8b89de26ec8c2da5f94a5 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 1 Oct 2020 17:22:06 -0700 Subject: [PATCH 1/2] mountinfo: rename FstypeFilter -> FSTypeFilter To be in line with the recent Fstype -> FSType renaming. Signed-off-by: Kir Kolyshkin --- mountinfo/mountinfo_filters.go | 4 ++-- mountinfo/mountinfo_linux_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mountinfo/mountinfo_filters.go b/mountinfo/mountinfo_filters.go index 31359d1e..feb2ddb0 100644 --- a/mountinfo/mountinfo_filters.go +++ b/mountinfo/mountinfo_filters.go @@ -45,8 +45,8 @@ func ParentsFilter(path string) FilterFunc { } } -// FstypeFilter returns all entries that match provided fstype(s). -func FstypeFilter(fstype ...string) FilterFunc { +// FSTypeFilter returns all entries that match provided fstype(s). +func FSTypeFilter(fstype ...string) FilterFunc { return func(m *Info) (bool, bool) { for _, t := range fstype { if m.FSType == t { diff --git a/mountinfo/mountinfo_linux_test.go b/mountinfo/mountinfo_linux_test.go index bed9ac5c..fadacde8 100644 --- a/mountinfo/mountinfo_linux_test.go +++ b/mountinfo/mountinfo_linux_test.go @@ -549,8 +549,8 @@ func TestParseMountinfoFilters(t *testing.T) { {PrefixFilter("nonexistent"), 0}, // 4 entries: /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup /sys / {ParentsFilter("/sys/fs/cgroup/cpu,cpuacct"), 4}, - {FstypeFilter("pstore"), 1}, - {FstypeFilter("proc", "sysfs"), 2}, + {FSTypeFilter("pstore"), 1}, + {FSTypeFilter("proc", "sysfs"), 2}, } var r bytes.Reader From 992946d10aac5eec76ad00485efd17e3c04a1ad5 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 1 Oct 2020 17:28:05 -0700 Subject: [PATCH 2/2] mountinfo/FilterFunc: fix doc Signed-off-by: Kir Kolyshkin --- mountinfo/mountinfo_filters.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mountinfo/mountinfo_filters.go b/mountinfo/mountinfo_filters.go index feb2ddb0..7a5eb6f3 100644 --- a/mountinfo/mountinfo_filters.go +++ b/mountinfo/mountinfo_filters.go @@ -7,8 +7,8 @@ import "strings" // and/or stop further processing if we found what we wanted. // // It takes a pointer to the Info struct (not fully populated, -// currently only Mountpoint, Fstype, Source, and (on Linux) -// VfsOpts are filled in), and returns two booleans: +// currently only Mountpoint, FSType, Source, and (on Linux) +// VFSOptions are filled in), and returns two booleans: // // - skip: true if the entry should be skipped // - stop: true if parsing should be stopped after the entry