Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/internal_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,10 @@ func (aw *AggregatedWorker) RegisterWorkflow(w interface{}) {
aw.executionParams.DefaultVersioningBehavior == VersioningBehaviorUnspecified {
panic("workflow type does not have a versioning behavior")
}
fnName := runtime.FuncForPC(reflect.ValueOf(w).Pointer()).Name()
if strings.HasSuffix(fnName, "-fm") {
aw.logger.Warn("Registering workflow" + fnName + ". It is recommended to only use struct methods to define activity functions. In some cases, struct methods as workflows may cause NDE errors.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pedantic, but would avoid the acronym NDE in user-facing contexts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the suggestion :)

}
aw.registry.RegisterWorkflow(w)
}

Expand Down
Loading