diff options
| author | Chris Lu <chris.lu@gmail.com> | 2014-04-15 09:09:40 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2014-04-15 09:09:40 -0700 |
| commit | cbc5a76e80b1bc45c642e2e2b601d9b7fa3634f7 (patch) | |
| tree | 963b8c5118d5fa0bc54ef0d09ba8457c2a440c60 /go/operation/lookup.go | |
| parent | b771f060f1fdb78bd561a2296d2aa1e4aa0f9136 (diff) | |
| download | seaweedfs-cbc5a76e80b1bc45c642e2e2b601d9b7fa3634f7.tar.xz seaweedfs-cbc5a76e80b1bc45c642e2e2b601d9b7fa3634f7.zip | |
Added batch file deleting.
Diffstat (limited to 'go/operation/lookup.go')
| -rw-r--r-- | go/operation/lookup.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/go/operation/lookup.go b/go/operation/lookup.go index 7e4f5dd08..e9d1586a3 100644 --- a/go/operation/lookup.go +++ b/go/operation/lookup.go @@ -53,7 +53,7 @@ func LookupFileId(server string, fileId string) (fullUrl string, err error) { return "http://" + lookup.Locations[rand.Intn(len(lookup.Locations))].PublicUrl + "/" + fileId, nil } -func LookupVolumeIds(server string, vids []string) ([]LookupResult, error) { +func LookupVolumeIds(server string, vids []string) (map[string]LookupResult, error) { values := make(url.Values) for _, vid := range vids { values.Add("volumeId", vid) @@ -62,10 +62,10 @@ func LookupVolumeIds(server string, vids []string) ([]LookupResult, error) { if err != nil { return nil, err } - var ret []LookupResult + ret := make(map[string]LookupResult) err = json.Unmarshal(jsonBlob, &ret) if err != nil { - return nil, err + return nil, errors.New(err.Error() + " " + string(jsonBlob)) } return ret, nil } |
