Hi -- thanks very much for your replies, and sorry for the lateness of mine -- I took a frustration break of a couple of days! :)
I have a tree of objects, the only existing bits of which currently are Config, Runner, and World.
These are composed in a main function, based on command-line flags and database records.
Persisting these is handled in a repo module, which needs to be able to get at fields of the objects to compose them into model objects which are then persisted. And it will need to do that in reverse, too, eventually.
And these objects are all going to have to interact with each other as part of the running program, as well as with a great number of other objects.
I want to be able to develop and test each module and object in complete isolation from everything else -- which is, of course, good practice.
However, I can't see a way to do this without generics.
I want to pass an object (which happens to be a Runner) to a repo object, which can assume that it can access its POD fields, and its struct fields, like World. Of course, for the isolation to be complete, the struct fields like World should also be abstractions. But any attempt I've made to achieve this without coupling has failed to compile.
I tried to work around this by using genny with `go generate`, but then ran into the wall of no function overloading.
How do other people go about removing the coupling that I'm struggling to eliminate?