fatih / structs

Utilities for Go structs

Home Page:http://godoc.org/github.com/fatih/structs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

creating an exported field

alphacentory opened this issue · comments

commented

Is it possible to create a field if it is unsettable?

Can you give more detail ? You can only create fields when you define a struct. After that it's not possible anymore.

commented

Ok, What I needed to be able to do is loop over two data structs. Compare one against other, and where different update. So if Struct1 has a field Struct2 doesn't, we create the field and assign a value.

Nope this is not possible. Structs are types that needs to be declared during compile time and can't be set in runtime.