diff --git a/multifilereader.go b/multifilereader.go index 758b501..cf3d14c 100644 --- a/multifilereader.go +++ b/multifilereader.go @@ -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{ @@ -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) { diff --git a/multifilereader_test.go b/multifilereader_test.go index 154c5b2..a7d6421 100644 --- a/multifilereader_test.go +++ b/multifilereader_test.go @@ -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) {