From a7d8d46306d37845d5375b21059192ce89050ac1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 4 Sep 2012 00:34:28 -0700 Subject: [PATCH] avoid null in json response --- weed-fs/src/cmd/weed/master.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed-fs/src/cmd/weed/master.go b/weed-fs/src/cmd/weed/master.go index a92b7c0f1..29b05efce 100644 --- a/weed-fs/src/cmd/weed/master.go +++ b/weed-fs/src/cmd/weed/master.go @@ -43,7 +43,7 @@ func dirLookupHandler(w http.ResponseWriter, r *http.Request) { volumeId, _ := storage.NewVolumeId(vid) machines, e := mapper.Get(volumeId) if e == nil { - var ret []map[string]string + ret:= []map[string]string{} for _, machine := range machines { ret = append(ret,map[string]string{"url": machine.Url, "publicUrl": machine.PublicUrl}) }