Ompluscator / dynamic-struct

Golang package for editing struct's fields during runtime and mapping structs to other structs.
MIT License
672 stars 83 forks source link

Can't add more than 1 field with same type #10

Closed adbakhram closed 4 years ago

adbakhram commented 4 years ago

instance := dynamicstruct.NewStruct(). AddField("Integer", 10, json:"int"). AddField("Text", "", json:"someText"). AddField("Text", "", json:"someText1"). AddField("Float", 0.0, json:"double"). AddField("Boolean", false, ""). AddField("Slice", []int{}, ""). AddField("Anonymous", "", json:"-"). Build(). New()

This will not work, will added only "someText1" field, but not someText"

adbakhram commented 4 years ago

Sorry, misunderstanted