In the documentation of the Go SDK, I see the defer used to complete a session. But when not using sessions, can I also use defer to execute a last workflow activity.
Conceptually, I want to execute a cleanup activity no matter the outcome of the previous activities.
Yes, executing any workflow code including activities is supported in the defer.
You should be careful about context passed to ExecuteActivity as it can be already cancelled. So I recommend using a disconnected context created through workflow.NewDisconnectedContext in the cleanup code.