aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--file.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/file.go b/file.go
index c5a6d42..e735723 100644
--- a/file.go
+++ b/file.go
@@ -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
}