useful go patterns when writing temporal.io stuff
if err := validateRolloverClusterCertInputs(input); err != nil {
return output, err
}
for _, future := range futures {
if err := future.Get(ctx, nil); err != nil {
return output, err
}
}
type (
rebootTemporal struct {
logger log.Logger
// no run method here
}
)
func (c *rebootTemporal) run(ctx workflow.Context, input Foo) (Bar, error) {
// ...
}
func SomeFn(ctx workflow.Context, input Foo) (Bar, error) {
// ...
c := &rebootTemporal{
logger: workflow.GetLogger(ctx),
}
return c.run(ctx, input) // you can .run it!!
}