The doc page for Go SDK: Failure detection - Temporal Go SDK feature guide | Temporal Documentation seems to have a possibly wrong import:
import (
// ...
"go.temporal.io/sdk/workflow"
// ...
)
func YourActivityDefinition(ctx, YourActivityDefinitionParam) (YourActivityDefinitionResult, error) {
// ...
activity.RecordHeartbeat(ctx, details)
// ...
}
should be (based on the import that worked in my project):
import (
// ...
"go.temporal.io/sdk/activity"
// ...
)
func YourActivityDefinition(ctx, YourActivityDefinitionParam) (YourActivityDefinitionResult, error) {
// ...
activity.RecordHeartbeat(ctx, details)
// ...
}