Open vearutop opened 1 year ago
This PR naively fixes false positive parsing of an invalid number that contains more than one . or e. https://github.com/valyala/fastjson/issues/88#issuecomment-1413818799
.
e
package main import ( "fmt" "github.com/valyala/fastjson" ) func main() { v, err := fastjson.ParseBytes([]byte(`[127.0.0.1]`)) if err != nil { fmt.Println("failed:", err.Error()) } else { fmt.Println("passed:", v.Type()) } err = fastjson.ValidateBytes([]byte(`[127.0.0.1]`)) if err != nil { fmt.Println("validation failed:", err.Error()) } // Output: // passed: array // validation failed: cannot parse JSON: cannot parse array: missing ',' after array value; unparsed tail: ".0.1]" }
This PR naively fixes false positive parsing of an invalid number that contains more than one
.
ore
. https://github.com/valyala/fastjson/issues/88#issuecomment-1413818799