diff --git a/file.go b/file.go index 719fd28..9491770 100644 --- a/file.go +++ b/file.go @@ -32,7 +32,7 @@ import ( type file struct { path string - Meta map[string]interface{} + Meta map[string]Meta reader *bytes.Reader asset string @@ -93,12 +93,12 @@ func (f *file) Path() string { return f.path } -func (f *file) Value(key string) (interface{}, bool) { +func (f *file) Value(key string) (Meta, bool) { value, ok := f.Meta[key] return value, ok } -func (f *file) SetValue(key string, value interface{}) { +func (f *file) SetValue(key string, value Meta) { f.Meta[key] = value } diff --git a/types.go b/types.go index 2451a9a..a66bb1e 100644 --- a/types.go +++ b/types.go @@ -46,8 +46,8 @@ func New(srcDir, dstDir string) Goldsmith { type File interface { Path() string - Value(key string) (interface{}, bool) - SetValue(key string, value interface{}) + Value(key string) (Meta, bool) + SetValue(key string, value Meta) CopyValues(src File) Read(p []byte) (int, error) @@ -58,7 +58,7 @@ type File interface { func NewFileFromData(path string, data []byte) File { return &file{ path: path, - Meta: make(map[string]interface{}), + Meta: make(map[string]Meta), reader: bytes.NewReader(data), } } @@ -66,7 +66,7 @@ func NewFileFromData(path string, data []byte) File { func NewFileFromAsset(path, asset string) File { return &file{ path: path, - Meta: make(map[string]interface{}), + Meta: make(map[string]Meta), asset: asset, } } @@ -105,3 +105,5 @@ type Finalizer interface { } type Plugin interface{} + +type Meta interface{}