Code-Fight commented on code in PR #897:
URL: 
https://github.com/apache/incubator-seata-go/pull/897#discussion_r2410453627


##########
pkg/saga/statemachine/engine/pcext/engine_utils.go:
##########
@@ -77,11 +116,16 @@ func EndStateMachine(ctx context.Context, processContext 
process_ctrl.ProcessCon
        }
        stateMachineInstance.SetEndParams(endParams)
 
-       stateInstruction, ok := 
processContext.GetInstruction().(StateInstruction)
-       if !ok {
+       switch v := processContext.GetInstruction().(type) {

Review Comment:
   GetInstruction() 既可能返回值,也可能返回指针,switch 是为了兼容和预防



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to