summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manager.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/manager.go b/manager.go
index 3253129..10de4ef 100644
--- a/manager.go
+++ b/manager.go
@@ -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{},
}