From 2ab5dabb4311cbbd03459d4b0fdcd26535021cfa Mon Sep 17 00:00:00 2001 From: WAKAYAMA shirou Date: Fri, 25 Apr 2014 16:38:23 +0900 Subject: [PATCH] fix return type. --- process_freebsd.go | 2 +- process_test.go | 4 ++-- process_windows.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/process_freebsd.go b/process_freebsd.go index 4a21716..1fce618 100644 --- a/process_freebsd.go +++ b/process_freebsd.go @@ -32,7 +32,7 @@ func Pids() ([]int32, error) { func (p *Process) Memory_Maps() (*[]Memory_mapsStat, error) { ret := make([]Memory_mapsStat, 0) - return ret, nil + return &ret, nil } func copy_params(k *Kinfo_proc, p *Process) error { diff --git a/process_test.go b/process_test.go index f6c5595..1366f91 100644 --- a/process_test.go +++ b/process_test.go @@ -3,9 +3,9 @@ package gopsutil import ( "encoding/json" "fmt" + "os" "runtime" "testing" - "os" ) func Test_Pids(t *testing.T) { @@ -35,7 +35,7 @@ func Test_Pid_exists(t *testing.T) { } func Test_NewProcess(t *testing.T) { - check_pid := 19472 + check_pid := 1 if runtime.GOOS == "windows" { check_pid = 0 } diff --git a/process_windows.go b/process_windows.go index 7c4754e..901ca8c 100644 --- a/process_windows.go +++ b/process_windows.go @@ -73,7 +73,7 @@ func Pids() ([]int32, error) { func (p *Process) Memory_Maps() (*[]Memory_mapsStat, error) { ret := make([]Memory_mapsStat, 0) - return ret, nil + return &ret, nil } func NewProcess(pid int32) (*Process, error) {