diff options
-rw-r--r-- | manager.go | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -69,11 +69,6 @@ func (i *StdinInput) Start() chan *Work { } func (f *StringFilter) Filter(w *Work) *Work { - if f.FilterFuncMap == nil { - f.FilterFuncMap = make(map[string]func(string) string, 10) - f.FilterFuncMap["F"] = func(s string) string { return strings.ToUpper(s) } - } - dec := json.NewDecoder(bytes.NewReader(w.data)) jm := make(map[string]string, 10) @@ -134,9 +129,12 @@ func (m *Manager) Run() { } func main() { + ffmap := make(map[string]func(string) string, 10) + ffmap["F"] = func(s string) string { return strings.ToUpper(s) } + m := Manager{ Input: &StdinInput{}, - Filter: &StringFilter{}, + Filter: &StringFilter{FilterFuncMap: ffmap}, Output: &StdoutOutput{}, } |