Tags: 0chain/msgp
Tags
msgp/unsafe: bring code in line with unsafe guidelines At some point the guidelines for unsafe[1] were changed such that allocating a variable of type 'reflect.StringHeader' or 'reflect.SliceHeader' is no longer permitted, and 'go vet' will soon reject code that does so[2]. Change the implementation of UnsafeString to avoid using an intermediate StringHeader altogether, and deprecate UnsafeBytes, as the new guidelines seem to indicate it cannot be implemented safely (escape analysis may not handle it correctly). [1] https://golang.org/pkg/unsafe/ [2] golang/go#40701
all: implement omitempty Handle the 'omitempty' struct tag similarly to encoding/json Fixes tinylib#263
PreviousNext