From bf2bc2c180f6784e1a327ffcaafb136b92da94d8 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Fri, 1 Jan 2016 17:47:28 +0900 Subject: [PATCH] Removing Meta interface --- file.go | 6 +++--- types.go | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/file.go b/file.go index 9491770..719fd28 100644 --- a/file.go +++ b/file.go @@ -32,7 +32,7 @@ import ( type file struct { path string - Meta map[string]Meta + Meta map[string]interface{} reader *bytes.Reader asset string @@ -93,12 +93,12 @@ func (f *file) Path() string { return f.path } -func (f *file) Value(key string) (Meta, bool) { +func (f *file) Value(key string) (interface{}, bool) { value, ok := f.Meta[key] return value, ok } -func (f *file) SetValue(key string, value Meta) { +func (f *file) SetValue(key string, value interface{}) { f.Meta[key] = value } diff --git a/types.go b/types.go index a66bb1e..2451a9a 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) (Meta, bool) - SetValue(key string, value Meta) + Value(key string) (interface{}, bool) + SetValue(key string, value interface{}) 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]Meta), + Meta: make(map[string]interface{}), 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]Meta), + Meta: make(map[string]interface{}), asset: asset, } } @@ -105,5 +105,3 @@ type Finalizer interface { } type Plugin interface{} - -type Meta interface{}