I created a simple go library to output OpenSCAD code a few years ago. https://github.com/richi0/gocad