From 0cca7e27f04f4a84a042540b2d57d0ae6fe0f0f3 Mon Sep 17 00:00:00 2001 From: Ben McClelland Date: Wed, 15 Sep 2021 21:01:26 -0700 Subject: [PATCH] totl: use zero value for no matching xattrs --- scoutfs.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/scoutfs.go b/scoutfs.go index 2c7d633..4667adf 100644 --- a/scoutfs.go +++ b/scoutfs.go @@ -10,7 +10,6 @@ import ( "bufio" "bytes" "encoding/binary" - "errors" "fmt" "io" "os" @@ -873,12 +872,6 @@ type XattrTotal struct { Count uint64 } -var ( - // ErrNoTotal is a special error case indicating that there were - // no xattrs matching the totl ids - ErrNoTotal = errors.New("no totl found") -) - // ReadXattrTotals returns the XattrTotal for the given id func ReadXattrTotals(f *os.File, id1, id2, id3 uint64) (XattrTotal, error) { totls := make([]xattrTotal, 1) @@ -894,7 +887,7 @@ func ReadXattrTotals(f *os.File, id1, id2, id3 uint64) (XattrTotal, error) { return XattrTotal{}, err } if n == 0 { - return XattrTotal{}, ErrNoTotal + return XattrTotal{}, nil } return XattrTotal{