Re: [go-nuts] Get all attributes with zero value using reflection

2016-08-03 Thread Nick Craig-Wood
On 03/08/16 07:34, Rayland wrote: > How can I use reflect to detect all fields that have the zero value, on > a pointer object? Here is a bit of code I wrote which overrides all the non zero fields in one struct, from another which might be helpful for you to look at. // SetDefaults for config fr

Re: [go-nuts] Get all attributes with zero value using reflection

2016-08-03 Thread 'Axel Wagner' via golang-nuts
You use https://godoc.org/reflect#Value.Field https://godoc.org/reflect#Zero https://godoc.org/reflect#Value.Interface and read the docs :) Don't take this the wrong way, but reflect isn't for the gentle-spirited, it's ugly, errorprone and hard. You probably don't want to use it and if you need to

[go-nuts] Get all attributes with zero value using reflection

2016-08-02 Thread Rayland
Hi all, How can I use reflect to detect all fields that have the zero value, on a pointer object? Thank you -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to g