From bfe7890e2b96498f082eefecf777a05dcb2bda5a Mon Sep 17 00:00:00 2001 From: WAKAYAMA shirou Date: Tue, 20 May 2014 19:29:41 +0900 Subject: [PATCH] fix return type. --- load_freebsd.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/load_freebsd.go b/load_freebsd.go index d3c508e..c021a30 100644 --- a/load_freebsd.go +++ b/load_freebsd.go @@ -6,26 +6,26 @@ import ( "strconv" ) -func LoadAvg() (LoadAvgStat, error) { +func LoadAvg() (*LoadAvgStat, error) { values, err := doSysctrl("vm.loadavg") if err != nil { - return LoadAvgStat{}, err + return nil, err } load1, err := strconv.ParseFloat(values[0], 64) if err != nil { - return LoadAvgStat{}, err + return nil, err } load5, err := strconv.ParseFloat(values[1], 64) if err != nil { - return LoadAvgStat{}, err + return nil, err } load15, err := strconv.ParseFloat(values[2], 64) if err != nil { - return LoadAvgStat{}, err + return nil, err } - ret := LoadAvgStat{ + ret := &LoadAvgStat{ Load1: float64(load1), Load5: float64(load5), Load15: float64(load15),