Browse Source

avoid null in json response

pull/2/head
Chris Lu 13 years ago
parent
commit
a7d8d46306
  1. 2
      weed-fs/src/cmd/weed/master.go

2
weed-fs/src/cmd/weed/master.go

@ -43,7 +43,7 @@ func dirLookupHandler(w http.ResponseWriter, r *http.Request) {
volumeId, _ := storage.NewVolumeId(vid) volumeId, _ := storage.NewVolumeId(vid)
machines, e := mapper.Get(volumeId) machines, e := mapper.Get(volumeId)
if e == nil { if e == nil {
var ret []map[string]string
ret:= []map[string]string{}
for _, machine := range machines { for _, machine := range machines {
ret = append(ret,map[string]string{"url": machine.Url, "publicUrl": machine.PublicUrl}) ret = append(ret,map[string]string{"url": machine.Url, "publicUrl": machine.PublicUrl})
} }

Loading…
Cancel
Save