Let's say I have a library package called foobar.
Over time it became big and heavy.
Fortunately it's separable, I managed to split its functionality into two separate packages foo and bar -- most clients will only need to use one or the other.
Since my library is already in use by many clients, for compatibility I still want to maintain a foobar package as a proxy to the current functionality found in both foo and bar.
How does one achieve this in Go ?
One way that comes to mind is to create aliases in foobar for each struct/function in foo and bar. So if foo defines F()
and bar defines B()
, I would have in foobar:
var (
F = foo.F
B = bar.B
)
But I am hoping for an easier/cleaner way.