@@ -1567,9 +1567,6 @@ const DefaultVersion Version = -1
15671567// CadenceChangeVersion is used as search attributes key to find workflows with specific change version.
15681568const CadenceChangeVersion = "CadenceChangeVersion"
15691569
1570- // GetVersionOption configures GetVersion behavior
1571- type GetVersionOption func (* GetVersionOptions )
1572-
15731570// GetVersionOptions contains options for GetVersion
15741571type GetVersionOptions struct {
15751572 // CustomVersion is used to force GetVersion to return a specific version
@@ -1581,7 +1578,7 @@ type GetVersionOptions struct {
15811578 UseMinVersion bool
15821579}
15831580
1584- // ExecuteWithVersion returns a GetVersionOption that forces a specific version to be returned
1581+ // ExecuteWithVersion returns a GetVersionOptions that forces a specific version to be returned
15851582// when executed for the first time, instead of returning maxSupported version.
15861583//
15871584// This option can be used when you want to separate the versioning of the workflow code and
@@ -1637,18 +1634,18 @@ type GetVersionOptions struct {
16371634//
16381635// ExecuteWithVersion option is useful when you want to ensure that your changes can be safely rolled back if needed, as
16391636// both versions of the workflow code are compatible with each other.
1640- func ExecuteWithVersion (version Version ) GetVersionOption {
1641- return func ( o * GetVersionOptions ) {
1642- o . CustomVersion = & version
1637+ func ExecuteWithVersion (version Version ) GetVersionOptions {
1638+ return GetVersionOptions {
1639+ CustomVersion : & version ,
16431640 }
16441641}
16451642
1646- // ExecuteWithMinVersion returns a GetVersionOption that makes GetVersion return minSupported version
1643+ // ExecuteWithMinVersion returns a GetVersionOptions that makes GetVersion return minSupported version
16471644// when executed for the first time, instead of returning maxSupported version.
16481645// To see how this option can be used, see the ExecuteWithVersion option
1649- func ExecuteWithMinVersion () GetVersionOption {
1650- return func ( o * GetVersionOptions ) {
1651- o . UseMinVersion = true
1646+ func ExecuteWithMinVersion () GetVersionOptions {
1647+ return GetVersionOptions {
1648+ UseMinVersion : true ,
16521649 }
16531650}
16541651
@@ -1718,12 +1715,12 @@ func ExecuteWithMinVersion() GetVersionOption {
17181715// } else {
17191716// err = workflow.ExecuteActivity(ctx, qux, data).Get(ctx, nil)
17201717// }
1721- func GetVersion (ctx Context , changeID string , minSupported , maxSupported Version , opts ... GetVersionOption ) Version {
1718+ func GetVersion (ctx Context , changeID string , minSupported , maxSupported Version , opts ... GetVersionOptions ) Version {
17221719 i := getWorkflowInterceptor (ctx )
17231720 return i .GetVersion (ctx , changeID , minSupported , maxSupported , opts ... )
17241721}
17251722
1726- func (wc * workflowEnvironmentInterceptor ) GetVersion (ctx Context , changeID string , minSupported , maxSupported Version , opts ... GetVersionOption ) Version {
1723+ func (wc * workflowEnvironmentInterceptor ) GetVersion (ctx Context , changeID string , minSupported , maxSupported Version , opts ... GetVersionOptions ) Version {
17271724 return wc .env .GetVersion (changeID , minSupported , maxSupported , opts ... )
17281725}
17291726
0 commit comments