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:
parent
309b313162
commit
72d8576185
2 changed files with 20 additions and 39 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue