From c03c8754dc433f562bc8630e75940ba24b4d559e Mon Sep 17 00:00:00 2001 From: Arnaud Ysmal Date: Mon, 17 Mar 2014 21:36:19 +0100 Subject: [PATCH] Return the array instead of a pointer to the array for Search and Revisions. --- dropbox.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dropbox.go b/dropbox.go index 38d5a3c..8eb454b 100644 --- a/dropbox.go +++ b/dropbox.go @@ -574,7 +574,7 @@ func (db *Dropbox) Media(path string) (*Link, error) { // Search searches the entries matching all the words contained in query in the given path. // The maximum number of entries and whether to consider deleted file may be given. -func (db *Dropbox) Search(path, query string, fileLimit int, includeDeleted bool) (*[]Entry, error) { +func (db *Dropbox) Search(path, query string, fileLimit int, includeDeleted bool) ([]Entry, error) { var rv []Entry var params *url.Values @@ -588,7 +588,7 @@ func (db *Dropbox) Search(path, query string, fileLimit int, includeDeleted bool } act := strings.Join([]string{"search", db.RootDirectory, path}, "/") err := db.doRequest("GET", act, params, &rv) - return &rv, err + return rv, err } // Delta gets modifications since the cursor. @@ -716,7 +716,7 @@ func (db *Dropbox) CopyRef(src string) (*CopyRef, error) { } // Revisions gets the list of revisions for a file. -func (db *Dropbox) Revisions(src string, revLimit int) (*[]Entry, error) { +func (db *Dropbox) Revisions(src string, revLimit int) ([]Entry, error) { var rv []Entry if revLimit <= 0 { revLimit = RevisionsLimitDefault @@ -726,7 +726,7 @@ func (db *Dropbox) Revisions(src string, revLimit int) (*[]Entry, error) { act := strings.Join([]string{"revisions", db.RootDirectory, src}, "/") err := db.doRequest("GET", act, &url.Values{"rev_limit": {strconv.FormatInt(int64(revLimit), 10)}}, &rv) - return &rv, err + return rv, err } // Restore restores a deleted file at the corresponding revision.