Refactor meminfo_bsd.go to use sysctl_bsd.go (#501)

* Refactor meminfo_bsd.go to use sysctl_bsd.go

* Fixed spelling.
This commit is contained in:
Derek Marcotte 2017-03-07 20:54:28 -05:00 committed by Tobias Schmidt
commit 72d8576185
2 changed files with 20 additions and 39 deletions

View file

@ -48,6 +48,9 @@ type bsdSysctl struct {
// Sysctl data-type
dataType bsdSysctlType
// Post-retrieval conversion hooks
conversion func(uint64) uint64
}
func (b bsdSysctl) Value() (float64, error) {
@ -66,5 +69,9 @@ func (b bsdSysctl) Value() (float64, error) {
return 0, err
}
if b.conversion != nil {
return float64(b.conversion(tmp64)), nil
}
return float64(tmp64), nil
}