commit eb6e5994c712d1e934f6bdd99188ac48317ef3c5
parent faf5d223493313a42bfaf8572fd0457eeb38851c
Author: Francois Parquet <francois.parquet@gmail.com>
Date: Mon, 25 Mar 2019 16:58:17 +0800
Merge pull request #105 from hyperjiang/master
fix typo in code generator readme
Diffstat:
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"`
}
```