-
Notifications
You must be signed in to change notification settings - Fork 260
Open
Description
PR: #2050
Support fmt.Stringer
in getFunctionName
Description
Currently, getFunctionName
only supports raw strings or function pointers.
If a caller passes a custom type that implements fmt.Stringer
(e.g. a named type alias), it is treated as a function and causes error and hard to get the idea why:
INF log/with_logger.go:45 Task processing failed with error Namespace=default TaskQueue=chat-agent [email protected]@ WorkerType=WorkflowWorker Error="BadScheduleActivityAttributes: ActivityType is not set on ScheduleActivityTaskCommand. ActivityID=15"
Example
type ActivityName string
func (a ActivityName) String() string {
return string(a)
}
var agentPlannerActivity ActivityName = "AgentPlannerActivity"
fut := workflow.ExecuteActivity(ctx, agentPlannerActivity, inputs{})
Metadata
Metadata
Assignees
Labels
No labels