We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d053c36 commit adfee58Copy full SHA for adfee58
fstat/fstat.go
@@ -24,8 +24,11 @@ func (fs FilesystemStat) Total() uint64 {
24
// HasReachedLimit returns true if the used disk space is greater than or equal
25
// to the given limit in percent.
26
func (fs FilesystemStat) HasReachedLimit(limit uint64) bool {
27
- used := uint64((float64(fs.Used()) / float64(fs.Total())) * 100)
28
- return used >= limit
+ return fs.usedPercentage() >= limit
+}
29
+
30
+func (fs FilesystemStat) usedPercentage() uint64 {
31
+ return uint64((float64(fs.Used()) / float64(fs.Total())) * 100)
32
}
33
34
func GetFilesystemStat(path string) (FilesystemStat, error) {
0 commit comments