Generate HCL from Provider Schema

I’m looking for a dynamic approach to generating an HCL script based on the Schema of a given Datasource or Resource in Go.

I can see that to a certain extent the terraform-cli is capable of doing this in -generate-config-out=.

Is there any go module that could help with this approach?