Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
files2.0: no error from NewMultiFileReader
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Dec 3, 2018
1 parent f732b39 commit bc7a700
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions multifilereader.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type MultiFileReader struct {
// NewMultiFileReader constructs a MultiFileReader. `file` can be any `commands.Directory`.
// If `form` is set to true, the multipart data will have a Content-Type of 'multipart/form-data',
// if `form` is false, the Content-Type will be 'multipart/mixed'.
func NewMultiFileReader(file Directory, form bool) (*MultiFileReader, error) {
func NewMultiFileReader(file Directory, form bool) *MultiFileReader {
it := file.Entries()

mfr := &MultiFileReader{
Expand All @@ -45,7 +45,7 @@ func NewMultiFileReader(file Directory, form bool) (*MultiFileReader, error) {
}
mfr.mpWriter = multipart.NewWriter(&mfr.buf)

return mfr, nil
return mfr
}

func (mfr *MultiFileReader) Read(buf []byte) (written int, err error) {
Expand Down
6 changes: 1 addition & 5 deletions multifilereader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ func getTestMultiFileReader(t *testing.T) *MultiFileReader {
})

// testing output by reading it with the go stdlib "mime/multipart" Reader
r, err := NewMultiFileReader(sf, true)
if err != nil {
t.Fatal(err)
}
return r
return NewMultiFileReader(sf, true)
}

func TestMultiFileReaderToMultiFile(t *testing.T) {
Expand Down

0 comments on commit bc7a700

Please sign in to comment.