sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

Generate DeepCopy methods

Open spolti opened this issue 2 years ago • 2 comments

What would you like to be added: When working with hard typed Workflow definition, we might need to define the base workflow struct and import the types from sdk-go.

import github.com/serverlessworkflow/sdk-go/v2
...
type WorkflowSpec struct {
	Retry      model.Retry      `json:"retry"`
}

Such scenario can thrown the following compilation error:

api/v08/zz_generated.deepcopy.go:807:13: in.Retries.DeepCopyInto undefined (type model.Retry has no field or method DeepCopyInto)

We can rely on https://pkg.go.dev/k8s.io/gengo/examples/deepcopy-gen to have these automatically generated.

spolti avatar Oct 07 '22 14:10 spolti

/assign

amadhusu avatar Oct 11 '22 18:10 amadhusu

@amadhusu there is a draft here, if you want to continue from there https://github.com/spolti/sdk-go/tree/deepCopy

spolti avatar Oct 11 '22 20:10 spolti