FinnTew commented on code in PR #741: URL: https://github.com/apache/incubator-seata-go/pull/741#discussion_r1888895127
########## 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" The package converts all values to the float64 type when parsing json, but the "FLOAT64" is used. yaml.v3" When the package parses yaml, it will correspond to the float64 and int types respectively, the changes here are mainly for compatibility 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