I am using google grpc with a json proxy. for some reason i need to remove the omitempty
tags from the struct generated in the *.pb.go files.
if i have a pr
A [more] portable solution:
Use sed
to strip the tags after generating via protoc
.
Example of what I actually use in my go:generate script after having generated the *.pb.go files:
ls *.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}'
Note: sed -i
(inline-replacement) is not used here because that flag isn't portable between standard OS-X and Linux.