Ompluscator / dynamic-struct

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

How to change a type of a field #25

Closed MarcelXia closed 1 year ago

MarcelXia commented 2 years ago

I'm looking for the example how to change the type of a field

Ompluscator commented 1 year ago

Hi.

Conversion of type on existing instance of some struct is not covered here. But, if you would like to adapt the field type for new instance, you can use GetField & SetType methods from library. :)