diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-07-26 10:52:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-26 10:52:24 -0700 |
commit | 90e5e279c175b238d58432acb5eb6422ddfe22e7 (patch) | |
tree | 0fc73fc058225ca7a889e85126a866e5612a8fa5 /app/file.go | |
parent | bae26ec268aef4e85d5055f1b83c6b3992bf178f (diff) | |
download | chat-90e5e279c175b238d58432acb5eb6422ddfe22e7.tar.gz chat-90e5e279c175b238d58432acb5eb6422ddfe22e7.tar.bz2 chat-90e5e279c175b238d58432acb5eb6422ddfe22e7.zip |
Fix file streaming to close files. (#9168)
Diffstat (limited to 'app/file.go')
-rw-r--r-- | app/file.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/file.go b/app/file.go index 537f76aaa..8cee3d740 100644 --- a/app/file.go +++ b/app/file.go @@ -70,7 +70,8 @@ func (a *App) ReadFile(path string) ([]byte, *model.AppError) { return backend.ReadFile(path) } -func (a *App) FileReader(path string) (io.Reader, *model.AppError) { +// Caller must close the first return value +func (a *App) FileReader(path string) (io.ReadCloser, *model.AppError) { backend, err := a.FileBackend() if err != nil { return nil, err |