Skip to content

Commit

Permalink
turn runtime.File into io.ReadCloser
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Dec 19, 2017
1 parent 6da7409 commit e64426d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion file.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ type File struct {
Header *multipart.FileHeader
}

func (f File) Read(p []byte) (n int, err error) {
// Read bytes from the file
func (f *File) Read(p []byte) (n int, err error) {
return f.Data.Read(p)
}

// Close the file
func (f *File) Close() error {
return f.Data.Close()
}

0 comments on commit e64426d

Please sign in to comment.