I have several hundred records of metadata I need available to my Go program. I would like the data to be compiled into the binary so it just works, avoiding dependencies on additional files to run.
The metadata starts as csv, and I have a another package that processes the csv into structs. The main program uses these structs by importing that package. The csv only changes occasionally.
I learned how to import and export the structs as gobs, but I would need to store those gobs in a file (etc) and load them in at runtime.
I looked at making shared libraries, but those are in ELF format and don't seem to support the native Go structs I need.
I could have the csv-processing package literally print out go code to recreate these struct instances (with say a base64-encoded gob of it), to be built with the main program, but that seems like an awfully roundabout way to go about this.
Is there a simple way to embed this prepared struct data into my binary?