From f2d0ac3ef947bef6669cdeb9c49fc2d846296ea1 Mon Sep 17 00:00:00 2001 From: Evgeny Proydakov Date: Thu, 23 Mar 2017 18:22:21 +0300 Subject: [PATCH 1/3] Added goreportcard --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 384f72c..74f3efe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# easyjson [![Build Status](https://travis-ci.org/mailru/easyjson.svg?branch=master)](https://travis-ci.org/mailru/easyjson) +# easyjson [![Build Status](https://travis-ci.org/mailru/easyjson.svg?branch=master)](https://travis-ci.org/mailru/easyjson) [![Go Report Card](https://goreportcard.com/badge/github.com/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 From ffd2765b618a7f74b4f847b435b407c92f729bb1 Mon Sep 17 00:00:00 2001 From: Evgeny Proydakov Date: Thu, 23 Mar 2017 18:25:19 +0300 Subject: [PATCH 2/3] Fixed misspell --- buffer/pool.go | 2 +- jlexer/lexer.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buffer/pool.go b/buffer/pool.go index bc936c1..07fb4bc 100644 --- a/buffer/pool.go +++ b/buffer/pool.go @@ -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) } diff --git a/jlexer/lexer.go b/jlexer/lexer.go index d4c16f1..16e320d 100644 --- a/jlexer/lexer.go +++ b/jlexer/lexer.go @@ -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. From eb9fd698911a098b91a81e1e5432cdb8599d6eb0 Mon Sep 17 00:00:00 2001 From: Evgeny Proydakov Date: Thu, 23 Mar 2017 18:30:56 +0300 Subject: [PATCH 3/3] Fixed go_vet --- jlexer/bytestostr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jlexer/bytestostr.go b/jlexer/bytestostr.go index 2ed8042..ff7b27c 100644 --- a/jlexer/bytestostr.go +++ b/jlexer/bytestostr.go @@ -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)) }