gojay

high performance JSON encoder/decoder with stream API for Golang
git clone git://git.lair.cx/gojay
Log | Files | Refs | README | LICENSE

commit dadfbac39fb7cba244576fc031dbb739bde5e0ce
parent faf5d223493313a42bfaf8572fd0457eeb38851c
Author: Hyper <hyper.jiang@lalamove.com>
Date:   Mon, 25 Mar 2019 15:38:59 +0800

fix typo in code generator readme

Diffstat:
Mgojay/README.md | 26+++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/gojay/README.md b/gojay/README.md @@ -1,22 +1,22 @@ # Gojay code generator -This package provides a command line tool to generate gojay's marshaling and unmarshing interface implementation for custom struct type(s) +This package provides a command line tool to generate gojay's marshaling and unmarshaling interface implementation for custom struct type(s) ## Get started ```sh -go install github.com/francoispqt/gojay/gojaygen +go install github.com/francoispqt/gojay/gojay ``` -## Generate code +## Generate code ### Basic command The basic command is straightforward and easy to use: ```sh cd $GOPATH/src/github.com/user/project -gojaygen -s . -p true -t MyType -o output.go +gojay -s . -p true -t MyType -o output.go ``` -If you just want to the output to stdout, omit the -o flag. +If you just want to the output to stdout, omit the -o flag. ### Using flags - s Source file/dir path, can be a relative or absolute path @@ -25,7 +25,7 @@ If you just want to the output to stdout, omit the -o flag. - o Output file (relative or absolute path) - p Pool to reuse object (using sync.Pool) -Examples: +Examples: - Generate `SomeType` type in `/tmp/myproj` go package, write to file `output.go`: ```sh @@ -46,16 +46,16 @@ You can add tags to your structs to control: - the use of omitempty methods for marshaling - timeFormat (java style data format) - timeLayout (golang time layout) - -### Example: + +### Example: ```go type A struct { - Str string `json:"string"` - StrOmitEmpty string `json:"stringOrEmpty,omitempty"` - Skip string `json:"-"` - StartTime time.Time `json:"startDate" timeFormat:"yyyy-MM-dd HH:mm:ss"` - EndTime *time.Time `json:"endDate" timeLayout:"2006-01-02 15:04:05"` + Str string `json:"string"` + StrOmitEmpty string `json:"stringOrEmpty,omitempty"` + Skip string `json:"-"` + StartTime time.Time `json:"startDate" timeFormat:"yyyy-MM-dd HH:mm:ss"` + EndTime *time.Time `json:"endDate" timeLayout:"2006-01-02 15:04:05"` } ```