Open kallydev opened 2 months ago
actionBuilder := activity.NewActionBuilder(type.TransactionTransfer, from, to) actionBuilder.SetPlatform(decentralized.Platform1Inch) action, err := actionBuilder.Build() // Build and check all fields.
Using Activity and Action structures directly can easily lead to invalid or missing values in some fields, which can be avoided using builder pattern.
Activity
Action
No response
This can ensure that the necessary fields are assigned at compile time, but the checks for the values of the fields are still at runtime.
What feature is it?
What problem does this feature solve?
Using
Activity
andAction
structures directly can easily lead to invalid or missing values in some fields, which can be avoided using builder pattern.Additional description
No response
This is not a duplicated feature request or new worker proposal