mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
@@ -1,4 +1,4 @@
|
||||
# easyjson [](https://travis-ci.org/mailru/easyjson)
|
||||
# easyjson [](https://travis-ci.org/mailru/easyjson) [](https://goreportcard.com/report/github.com/mailru/easyjson)
|
||||
|
||||
Package easyjson provides a fast and easy way to marshal/unmarshal Go structs
|
||||
to/from JSON without the use of reflection. In performance tests, easyjson
|
||||
|
||||
+1
-1
@@ -248,7 +248,7 @@ func (r *readCloser) Read(p []byte) (n int, err error) {
|
||||
}
|
||||
|
||||
func (r *readCloser) Close() error {
|
||||
// Release all remainig buffers.
|
||||
// Release all remaining buffers.
|
||||
for _, buf := range r.bufs {
|
||||
putBuf(buf)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ import (
|
||||
// may be garbage-collected even when the string exists.
|
||||
func bytesToStr(data []byte) string {
|
||||
h := (*reflect.SliceHeader)(unsafe.Pointer(&data))
|
||||
shdr := reflect.StringHeader{h.Data, h.Len}
|
||||
shdr := reflect.StringHeader{Data: h.Data, Len: h.Len}
|
||||
return *(*string)(unsafe.Pointer(&shdr))
|
||||
}
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ type Lexer struct {
|
||||
wantSep byte // A comma or a colon character, which need to occur before a token.
|
||||
|
||||
UseMultipleErrors bool // If we want to use multiple errors.
|
||||
fatalError error // Fatal error occured during lexing. It is usually a syntax error.
|
||||
multipleErrors []*LexerError // Semantic errors occured during lexing. Marshalling will be continued after finding this errors.
|
||||
fatalError error // Fatal error occurred during lexing. It is usually a syntax error.
|
||||
multipleErrors []*LexerError // Semantic errors occurred during lexing. Marshalling will be continued after finding this errors.
|
||||
}
|
||||
|
||||
// FetchToken scans the input for the next token.
|
||||
|
||||
Reference in New Issue
Block a user