fieldalignment of all structs to save memory

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-04-27 08:32:47 +03:00
parent ee11f39a2f
commit 86626c5922
78 changed files with 343 additions and 410 deletions

View File

@@ -63,9 +63,7 @@ func Unmarshal(dst interface{}, query string) error {
// possible. Eg the example above would output:
// {"bar":{"one":{"two":2,"red":112}}}
func ToJSON(query string) ([]byte, error) {
var (
builder interface{} = make(map[string]interface{})
)
var builder interface{} = make(map[string]interface{})
params := strings.Split(query, "&")
for _, part := range params {
tempMap, err := queryToMap(part)

View File

@@ -32,9 +32,10 @@ type unmarshalT struct {
A string `json:"a"`
B unmarshalB `json:"b"`
}
type unmarshalB struct {
C int `json:"c"`
D string `json:"D"`
C int `json:"c"`
}
func TestUnmarshal(t *testing.T) {