File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,11 +12,18 @@ standard `encoding/json` package, such as generating "snake_case" names or
1212enabling ` omitempty ` behavior by default.
1313
1414## Usage
15+ ### Install:
1516``` sh
16- # install
17+ # for Go < 1.17
1718go get -u github.com/mailru/easyjson/...
18-
19- # run
19+ ```
20+ #### or
21+ ``` sh
22+ # for Go >= 1.17
23+ go get github.com/mailru/easyjson && go install github.com/mailru/easyjson/...@latest
24+ ```
25+ ### Run:
26+ ``` sh
2027easyjson -all < file> .go
2128```
2229
@@ -28,6 +35,20 @@ environment variable to be set. This is because easyjson code generation
2835invokes ` go run ` on a temporary file (an approach to code generation borrowed
2936from [ ffjson] ( https://github.com/pquerna/ffjson ) ).
3037
38+ ### Serialize
39+ ``` go
40+ someStruct := &SomeStruct{Field1: " val1" , Field2 : " val2" }
41+ rawBytes , err := easyjson.Marshal (someStruct)
42+ ```
43+
44+ ### Deserialize
45+ ``` go
46+ someStruct := &SomeStruct{}
47+ err := easyjson.Unmarshal (rawBytes, someStruct)
48+ ```
49+
50+ Please see the [ GoDoc] ( https://godoc.org/github.com/mailru/easyjson )
51+ for more information and features.
3152## Options
3253``` txt
3354Usage of easyjson:
You can’t perform that action at this time.
0 commit comments