diff --git a/lib/action/action.go b/lib/action/action.go index 3ae4170..fe959e8 100644 --- a/lib/action/action.go +++ b/lib/action/action.go @@ -22,7 +22,7 @@ func (spec *baseSpec) Receivers() []string { return spec.receivers } -func Base(hdlr lib.ActionHandler, rcvrs []string) *baseSpec { +func Base(hdlr lib.ActionHandler, rcvrs ...string) *baseSpec { return &baseSpec{hdlr, rcvrs} } @@ -47,7 +47,7 @@ func match(ac lib.ActionConfig, msg lib.Message) bool { //return false } -// action +// action handling type action struct { ctx lib.Context diff --git a/tests/etc/etc.go b/tests/etc/etc.go index ae3adf2..75a08d1 100644 --- a/tests/etc/etc.go +++ b/tests/etc/etc.go @@ -14,7 +14,7 @@ func Config() lib.Config { ovr := Overrides().Use b := config.Base - app_c := app.Cfg{ + app_c := &app.Cfg{ BaseCfg: b("testing", testing.Start), Home: ovr(".", HOME), AppType: "standard", @@ -22,21 +22,19 @@ func Config() lib.Config { Logfile: ovr("log/scopes.log", LOGFILE), }, } - app_c.AddAction("demo", - action.Base(action.Forward, - []string{"test-receiver"})) + app_c.AddAction("demo", action.Base(action.Forward, "test-receiver")) - config_c := config.Cfg{ + config_c := &config.Cfg{ BaseCfg: b("config", config.Start), ConfigFormat: "etc", } - app_c.Add(config_c) - test_rcvr := b("test-receiver", core.Start) - test_rcvr.AddAction("demo", action.Base(AH_Receiver, nil)) - app_c.Add(test_rcvr) + test_rcvr := b("test-receiver", core.Start). + AddAction("demo", action.Base(AH_Receiver)) - return &app_c + app_c.Add(config_c, test_rcvr) + + return app_c } // register action handlers from ..._test.go here.