Skip to content

Commit 3bc00c8

Browse files
committed
Fix the other name check, small typo
Signed-off-by: Tiago Scolari <[email protected]>
1 parent d341805 commit 3bc00c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

workflow/worker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ func getFunctionName(f interface{}) (string, error) {
9393
callSplit := strings.Split(runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name(), ".")
9494
funcName := callSplit[len(callSplit)-1]
9595

96-
const anonymousFunctionRegxp = "^func[0-9]+$"
97-
isAnonymousFunc, err := regexp.MatchString(anonymousFunctionRegxp, funcName)
96+
const anonymousFunctionRegexp = "^func[0-9]+$"
97+
isAnonymousFunc, err := regexp.MatchString(anonymousFunctionRegexp, funcName)
9898
if err != nil {
9999
return "", fmt.Errorf("failed to match anonymous function regexp: %w", err)
100100
}
@@ -175,7 +175,7 @@ func (ww *WorkflowWorker) RegisterActivity(a Activity, opts ...registerOption) e
175175
}
176176
}
177177

178-
if options.Name != "" {
178+
if options.Name == "" {
179179
// get the function name for the passed workflow if there's
180180
// no explicit name provided.
181181
name, err := getFunctionName(a)

0 commit comments

Comments
 (0)