diff options
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 } |