fix the capacity of make disk on FreeBSD.

pull/4/head
WAKAYAMA shirou 11 years ago
parent b4a1a26e11
commit f84631cfb6

@ -17,7 +17,7 @@ func DiskPartitions(all bool) ([]DiskPartitionStat, error) {
return ret, err
}
fs := make([]Statfs, 0, count)
fs := make([]Statfs, count)
_, err = Getfsstat(fs, MNT_WAIT)
for _, stat := range fs {

@ -22,7 +22,7 @@ func TestDisk_usage(t *testing.T) {
func TestDisk_partitions(t *testing.T) {
ret, err := DiskPartitions(false)
if err != nil {
if err != nil || len(ret) == 0 {
t.Errorf("error %v", err)
}
empty := DiskPartitionStat{}
@ -35,7 +35,7 @@ func TestDisk_partitions(t *testing.T) {
func TestDisk_io_counters(t *testing.T) {
ret, err := DiskIOCounters()
if err != nil {
if err != nil || len(ret) == 0 {
t.Errorf("error %v", err)
}
empty := DiskIOCountersStat{}

Loading…
Cancel
Save