You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varstackbuf [unescapeStackBufSize]byte// stack-allocated array for allocation-free unescaping of small strings (hopefully; the Go compiler might just always kick stackbuf[:] into the heap)
465
+
returnUnescape(b, stackbuf[:])
466
+
}
467
+
468
+
// ParseString parses a String ValueType into a Go string (the main parsing work is unescaping the JSON string)
469
+
funcParseString(b []byte) (string, error) {
470
+
ifbU, err:=parseStringAsBytes(b); err!=nil {
471
+
return"", nil
457
472
} else {
458
-
val=false
473
+
returnstring(bU), nil
459
474
}
475
+
}
460
476
461
-
return
477
+
// ParseNumber parses a Number ValueType into a Go float64
478
+
funcParseFloat(b []byte) (float64, error) {
479
+
ifv, err:=parseFloat(&b); err!=nil {
480
+
return0, MalformedValueError
481
+
} else {
482
+
returnv, nil
483
+
}
462
484
}
485
+
486
+
// ParseNumber parses a Number ValueType into a Go float64
0 commit comments