From ad69374f8b132f0afddb9203300c600b9f21386b Mon Sep 17 00:00:00 2001 From: spf13 Date: Tue, 4 Nov 2014 00:28:20 -0500 Subject: [PATCH] Source files can provide content as String or Bytes or Reader --- source/file.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/file.go b/source/file.go index ce1469d5d..909d457db 100644 --- a/source/file.go +++ b/source/file.go @@ -39,6 +39,14 @@ func (f *File) UniqueId() string { return f.uniqueId } +func (f *File) String() string { + return helpers.ReaderToString(f.Contents) +} + +func (f *File) Bytes() []byte { + return helpers.ReaderToBytes(f.Contents) +} + // Filename without extension func (f *File) BaseFileName() string { return helpers.Filename(f.LogicalName())