xjlgod commented on code in PR #650:
URL: 
https://github.com/apache/incubator-seata-go/pull/650#discussion_r1464991919


##########
pkg/saga/statemachine/statelang/parser/statemachine_parser.go:
##########
@@ -52,22 +41,118 @@ func (b BaseStateParser) GetString(stateName string, 
stateMap map[string]interfa
        return valueAsString, nil
 }
 
-func (b BaseStateParser) GetSlice(stateName string, stateMap 
map[string]interface{}, key string) ([]interface{}, error) {
+func (b BaseStateParser) GetStringOrDefault(stateMap map[string]interface{}, 
key string, defaultValue string) string {
        value := stateMap[key]
+       if value == nil {
+               return defaultValue
+       }
+
+       valueAsString, ok := value.(string)
+       if !ok {

Review Comment:
   I throw err in all methods now.



-- 
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