Closed R-maan closed 3 years ago
I suspect (based on attempts of my own early on :)) that you're going to have a hard time moving too many implementation details into a separate package without creating dependency cycles. Go pretty strongly favors keeping implementation details as unexported types/functions in the same package that has the public API.
For ctxstack specifically, I think the relevant go-ism is "a little copying is better than a little dependency." :) It's not that big, I'd just copy/paste it over into cmd/ion-go
.
A couple of attempts to move internal code to an internal
folder run into the dependency issues. My take away here is that the use of internal
folder works best when the code to be moved there is a sub-module and a leaf dependency. Else the controls provided by Go to expose or hide elements seems like the best option.
Resolving.
To avoid exposing internal functions, we should move them into
internal
folder.