The standard pattern in go and some scala libs, is to define the spec and generate the code.
I think you're over fitting your own experiences.