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: [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]