Changes
2 changed files (+6/-6)
-
-
@@ -9,7 +9,7 @@ type withObjectFn func (*Object) errortype withActivityFn func (*Activity) error type withIntransitiveActivityFn func (*IntransitiveActivity) error type withQuestionFn func (*Question) error type withPersonFn func (*Person) error type withActorFn func (*Actor) error type withCollectionInterfaceFn func (collection CollectionInterface) error type withCollectionFn func (collection *Collection) error type withCollectionPageFn func (*CollectionPage) error
-
@@ -28,7 +28,7 @@ func OnObject(it Item, fn withObjectFn) error {return fn(ob) }) } else if ActorTypes.Contains(it.GetType()) { return OnPerson(it, func(p *Person) error { return OnActor(it, func(p *Actor) error { ob, err := ToObject(p) if err != nil { return err
-
@@ -93,8 +93,8 @@ func OnQuestion(it Item, fn withQuestionFn) error {return fn(act) } // OnPerson func OnPerson(it Item, fn withPersonFn) error { // OnActor func OnActor(it Item, fn withActorFn) error { if !ActorTypes.Contains(it.GetType()) { return errors.New(fmt.Sprintf("%T[%s] can't be converted to Person", it, it.GetType())) }
-
-
-
@@ -107,7 +107,7 @@ func TestOnQuestion(t *testing.T) {func TestOnPerson(t *testing.T) { pers := PersonNew("testPerson") err := OnPerson(pers, func(a *Person) error { err := OnActor(pers, func(a *Person) error { return nil })
-
@@ -115,7 +115,7 @@ func TestOnPerson(t *testing.T) {t.Errorf("Unexpected error returned %s", err) } err = OnPerson(pers, func(p *Person) error { err = OnActor(pers, func(p *Person) error { if p.Type != pers.Type { t.Errorf("In function type %s different than expected, %s", p.Type, pers.Type) }
-