Skip to content

Commit

Permalink
fix: check duplicate functions correctly (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
abelanger5 authored Jan 3, 2024
1 parent dca1516 commit b069347
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (w *Worker) registerAction(name string, method any) error {

// if action has already been registered, ensure that the method is the same
if currMethod, ok := w.actions[name]; ok {
if reflect.ValueOf(currMethod).Pointer() != reflect.ValueOf(method).Pointer() {
if reflect.ValueOf(currMethod.MethodFn()).Pointer() != reflect.ValueOf(method).Pointer() {
return fmt.Errorf("action %s is already registered with function %s", name, getFnName(currMethod.MethodFn()))
}
}
Expand Down

0 comments on commit b069347

Please sign in to comment.