From a615b32ca9b385becfc932b78d81510b6cb4bcd0 Mon Sep 17 00:00:00 2001 From: miraclesu Date: Fri, 17 Feb 2017 14:19:35 +0800 Subject: [PATCH] =?UTF-8?q?model:=20=E4=BF=AE=E5=A4=8D=20nil=20map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/group.go | 2 +- models/job.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/group.go b/models/group.go index 528c6db..7595fed 100644 --- a/models/group.go +++ b/models/group.go @@ -43,11 +43,11 @@ func GetGroups(nid string) (groups map[string]*Group, err error) { } count := len(resp.Kvs) + groups = make(map[string]*Group, count) if count == 0 { return } - groups = make(map[string]*Group, count) for _, g := range resp.Kvs { group := new(Group) if e := json.Unmarshal(g.Value, group); e != nil { diff --git a/models/job.go b/models/job.go index c8f09c9..1fe5545 100644 --- a/models/job.go +++ b/models/job.go @@ -98,11 +98,11 @@ func GetJobs() (jobs map[string]*Job, err error) { } count := len(resp.Kvs) + jobs = make(map[string]*Job, count) if count == 0 { return } - jobs = make(map[string]*Job, count) for _, j := range resp.Kvs { job := new(Job) if e := json.Unmarshal(j.Value, job); e != nil {