diff options
author | spf13 <steve.francia@gmail.com> | 2014-10-16 20:20:09 -0400 |
---|---|---|
committer | spf13 <steve.francia@gmail.com> | 2014-10-16 20:20:09 -0400 |
commit | 5dfc1dedb8ac53b7a2d3823d06808ae86f90b3d9 (patch) | |
tree | e90f9cfbcc920685dd9bceecd1925abec81ae0c0 /source/inmemory.go | |
parent | 24bbfe7d32fe151487ff87394433622e3f69eee4 (diff) |
Big refactor of how source files are used. Also added default destination extension option.
Diffstat (limited to 'source/inmemory.go')
-rw-r--r-- | source/inmemory.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/source/inmemory.go b/source/inmemory.go index 7c76469fe..c30aa3836 100644 --- a/source/inmemory.go +++ b/source/inmemory.go @@ -3,17 +3,15 @@ package source import ( "bytes" "fmt" - "path" ) type ByteSource struct { Name string Content []byte - Section string } func (b *ByteSource) String() string { - return fmt.Sprintf("%s %s %s", b.Name, b.Section, string(b.Content)) + return fmt.Sprintf("%s %s", b.Name, string(b.Content)) } type InMemorySource struct { @@ -23,12 +21,7 @@ type InMemorySource struct { func (i *InMemorySource) Files() (files []*File) { files = make([]*File, len(i.ByteSource)) for i, fake := range i.ByteSource { - files[i] = &File{ - LogicalName: fake.Name, - Contents: bytes.NewReader(fake.Content), - Section: fake.Section, - Dir: path.Dir(fake.Name), - } + files[i] = NewFileWithContents(fake.Name, bytes.NewReader(fake.Content)) } return } |