snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s
Some checks failed
master / ci (push) Failing after 0s
This commit is contained in:
23
components/cqrs/object.go
Normal file
23
components/cqrs/object.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package cqrs
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func isPointer(v interface{}) error {
|
||||
rv := reflect.ValueOf(v)
|
||||
|
||||
if rv.Kind() != reflect.Pointer || rv.IsNil() {
|
||||
return NonPointerError{rv.Type()}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type NonPointerError struct {
|
||||
Type reflect.Type
|
||||
}
|
||||
|
||||
func (e NonPointerError) Error() string {
|
||||
return "non-pointer command: " + e.Type.String() + ", handler.NewCommand() should return pointer to the command"
|
||||
}
|
||||
Reference in New Issue
Block a user