diff options
author | Santiago M. Mola <santi@mola.io> | 2016-11-30 17:04:29 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-11-30 17:04:29 +0100 |
commit | 606370479fbf0e315ccffcea8d86126c4a0c9db2 (patch) | |
tree | 891383ced1a78c9bf1a77bb9c9a68e0e636c3e0a /file.go | |
parent | ef1a0579fbc6aac510313ce073d1dd8fc8a9202b (diff) | |
download | go-git-606370479fbf0e315ccffcea8d86126c4a0c9db2.tar.gz |
file: return error on File.Contents() if reader fails (#150)
Diffstat (limited to 'file.go')
-rw-r--r-- | file.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -30,7 +30,9 @@ func (f *File) Contents() (content string, err error) { defer checkClose(reader, &err) buf := new(bytes.Buffer) - buf.ReadFrom(reader) + if _, err := buf.ReadFrom(reader); err != nil { + return "", err + } return buf.String(), nil } |