From ea0f864aefc8345f50c4b3f06662e4dfc527e693 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Mon, 22 Jul 2019 13:09:37 -0700 Subject: [PATCH 1/2] ignore /proc/filesystems errors on android --- disk/disk_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index 340f973..cb36751 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -10,6 +10,7 @@ import ( "io/ioutil" "os" "path/filepath" + "runtime" "strconv" "strings" @@ -244,7 +245,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro } fs, err := getFileSystems() - if err != nil { + if err != nil && runtime.GOOS != "android" { return nil, err } From 34b030b41c47513d8df6ac04de62c845c9c955a5 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Tue, 30 Jul 2019 17:59:09 -0700 Subject: [PATCH 2/2] Ignore getFileSystems errors when requesting all partitions --- disk/disk_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index cb36751..43b8b28 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -245,7 +245,7 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro } fs, err := getFileSystems() - if err != nil && runtime.GOOS != "android" { + if err != nil && all { return nil, err }