Skip to content

Commit

Permalink
Typo fix in README.md file
Browse files Browse the repository at this point in the history
A minor typo in the sentence "Therefore, the arguments for `Marshal` and `Unmarshal` are always escape to the heap."
The word "escape" should be "escaped" 馃檪
  • Loading branch information
asaf-shitrit committed Nov 15, 2022
1 parent 32ec93b commit 2163995
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func Marshal(v interface{}) ([]byte, error) {
`json.Marshal` and `json.Unmarshal` receive `interface{}` value and they perform type determination dynamically to process.
In normal case, you need to use the `reflect` library to determine the type dynamically, but since `reflect.Type` is defined as `interface`, when you call the method of `reflect.Type`, The reflect's argument is escaped.

Therefore, the arguments for `Marshal` and `Unmarshal` are always escape to the heap.
Therefore, the arguments for `Marshal` and `Unmarshal` are always escaped to the heap.
However, `go-json` can use the feature of `reflect.Type` while avoiding escaping.

`reflect.Type` is defined as `interface`, but in reality `reflect.Type` is implemented only by the structure `rtype` defined in the `reflect` package.
Expand Down

0 comments on commit 2163995

Please sign in to comment.