FinnTew commented on code in PR #741:
URL: 
https://github.com/apache/incubator-seata-go/pull/741#discussion_r1888899058


##########
pkg/saga/statemachine/statelang/parser/statemachine_parser.go:
##########
@@ -148,18 +148,23 @@ func (b BaseStateParser) GetIntOrDefault(stateName 
string, stateMap map[string]i
                return defaultValue, nil
        }
 
-       // just use float64 to convert, json reader will read all number as 
float64
-       valueAsFloat64, ok := value.(float64)
-       if !ok {
+       // use float64 conversion when the configuration file is json, and use 
int conversion when the configuration file is yaml

Review Comment:
   Because "encoding/json" package will convert all numerical values into 
float64 types when parsing json, but" yaml.v3" package will correspond to 
float64 and int types when parsing YAML, and the modification here is mainly to 
be compatible with the two formats, otherwise some errors will occur.



-- 
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: notifications-unsubscr...@seata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to