I have JSON file as config. The problem I may see is that this cannot be compiled in Go and I'm worried that this also might affect the performance of the application since JSON is imported for every request. Would I be better off using Struct
and initialising it in a separate Go file?
If you can store the configuration Go code, then I assume that the configuration does not change during the execution of the application. Load the configuration when the application starts and store the parsed representation in memory, possibly referenced from a package level variable.