Structomap is back again

structomap is back again

Hi everyone.

I've updated this library ( created long time ago because it solves a real problem in Go's webservices: to return different data as JSON response basing on arbitrary conditions.

For example, in a JSON response, I want to omit the user "password" field in all responses and maybe omit the field "balance" if the user is not an admin.

Using Golang tags on the struct is not enough, because I can only use the omitempty tag but not omit conditionally.

So the fastest way to avoid this problem is to convert a struct to a map and then render the map as JSON.

This library works well but it was unmaintained. So I've forked it and updated to be used with Golang 1.11 and 1.12 with modules support.

Now I've integrated it in 2 "echo" webservices and finally I am able to render JSON in a conditional way.

Do you need Golang support for your next big project? Ask us a quotation!

We work also with Rails, Django, NodeJs/Express, React and Vue.