Skip to content

Commit

Permalink
fix(NewFilesRequest, save): renamed NewMimeMultipartRequest to NewFil…
Browse files Browse the repository at this point in the history
…esRequest

fixed documentation spacing in cmd/save.go
  • Loading branch information
ramfox committed Feb 15, 2018
1 parent c815bd6 commit 35da882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions api/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func testMimeMultipart(t *testing.T, server *httptest.Server, client *http.Clien
t.Errorf("case add dataset from file, error reading expected response from file: %s", err)
}

req, err := MakeMimeMultipartReq(c.method, c.endpoint, server.URL+c.endpoint, c.filePaths, c.params)
req, err := NewFilesRequest(c.method, c.endpoint, server.URL+c.endpoint, c.filePaths, c.params)
if err != nil {
t.Errorf("testMimeMultipart case %d, %s - %s:\nerror making mime/multipart request: %s", i, c.method, c.endpoint, err)
continue
Expand Down Expand Up @@ -242,9 +242,9 @@ func testMimeMultipart(t *testing.T, server *httptest.Server, client *http.Clien
}
}

// MakeMimeMultipartBody takes a map of filepaths and params and add thems to a writer
// adds that writer to *bytes.Buffer that can then be used as the body for a request
func MakeMimeMultipartReq(method, endpoint, url string, filePaths, params map[string]string) (*http.Request, error) {
// NewFilesRequest creates a mime/multipart http.Request with files specified by a map of param : filepath,
// and form values specified by a map, params
func NewFilesRequest(method, endpoint, url string, filePaths, params map[string]string) (*http.Request, error) {
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)

Expand Down
3 changes: 2 additions & 1 deletion cmd/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ var saveCmd = &cobra.Command{
Short: "save changes to a dataset",
Long: `
Save is how you change a dataset, updating one or more of data, metadata, and
structure. You can also update your data via url. Every time you run save, an entry is added to your dataset’s log
structure. You can also update your data via url. Every time you run save,
an entry is added to your dataset’s log
(which you can see by running “qri log [ref]”). Every time you save, you can
provide a message about what you changed and why. If you don’t provide a message
we’ll automatically generate one for you.
Expand Down

0 comments on commit 35da882

Please sign in to comment.