koding / kite

Micro-service framework in Go
https://godoc.org/github.com/koding/kite
MIT License
3.26k stars 300 forks source link

dnode: rework scrubbing to make it work on go1.6+ - fixes #149 #159

Closed ppknap closed 8 years ago

ppknap commented 8 years ago

Go 1.6 introduced a breaking change in "reflect" package(golang issue #12367). This broke dnode.Scrubber.Scrub method that was using reflect.Value.Interface method to collect callbacks. Since go1.6 you cannot get an interface to private embedded structs so, if you passed embedded struct to Scrub method, it would panic.

This commit refactors Scrub method and makes it valid in >=go1.6.

Additionally, there is a minor fix which discards JSON field tag options when they are provided.

rjeczalik commented 8 years ago

LGTM 👍

Thanks @ppknap for fixing this 💥 ✨ 🚀 💯

cihangir commented 8 years ago

Thanks so much for spending time on this issue. 👍