Files
Kirill Korotaev 244a66fa8f Add "nocopy" json tag to return unsafe string reference
When large amounts of data are unmarshaled for immediate non long live use than
copying of strings from original buffer can be avoided and instead a
reference to the original buffer returned in the field value.

Note, if the value requires unescaping, than it will be processed as
normally done with copying.

Signed-off-by: Kirill Korotaev <kirillx@gmail.com>
2020-04-12 20:48:07 +03:00

8 lines
109 B
Go

package tests
//easyjson:json
type NocopyStruct struct {
A string `json:"a"`
B string `json:"b,nocopy"`
}