From 0d3a2ac515ed46dce275aa360b40b2702954bc00 Mon Sep 17 00:00:00 2001 From: Lomanic Date: Fri, 22 Feb 2019 19:31:08 +0100 Subject: [PATCH] [disk][linux] Fix comment in PartitionsWithContext --- disk/disk_linux.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/disk/disk_linux.go b/disk/disk_linux.go index 0546491..759259d 100644 --- a/disk/disk_linux.go +++ b/disk/disk_linux.go @@ -250,11 +250,6 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro for _, line := range lines { var d PartitionStat - // a line of self/mountinfo has the following structure: - // 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue - // (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) - - // split the mountinfo line by the separator hyphen if useMounts { fields := strings.Fields(line) @@ -271,6 +266,11 @@ func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, erro } } } else { + // a line of self/mountinfo has the following structure: + // 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue + // (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) + + // split the mountinfo line by the separator hyphen parts := strings.Split(line, " - ") if len(parts) != 2 { return nil, fmt.Errorf("found invalid mountinfo line in file %s: %s ", filename, line)