Executing Hugo builds inside of Go with a custom config?

I see that we can import hugo into another Go app and directly initiate a build with commands.Execute, and I see that we can get the struct for the Configs with hugolib.DefaultConfig, but it is not clear to me how I combine the two? Executeonly takes a []string(presumably of command line arguments).

Is the trick then to output the custom config to a file or pipe it into Hugo somehow? Is there a public method for converting the Config into a valid text file?