On Thu, Mar 4, 2021 at 3:54 PM Michael Ellis <michael.f.el...@gmail.com> wrote:
> Not sure if my case is all that special. Seems like the requirement for a > full path to an internal package breaks the concept of "internal" because > it gives everyone import access to whatever the internal package exports. > Really? I can't reproduce that. If I create a minimal module importing " github.com/Merovius/srvfb/internal/fb" and try to build that, I get an error message: foo.go:3:8: use of internal package github.com/Merovius/srvfb/internal/fb not allowed So, the internal mechanism seems to work just fine, to me? Note that "every importer needs to mention the full path" is not the same as "everyone mentioning the full path can import". > It would be good to have Russ and/or Ian weigh in on this. My feeling at > this point is that either "internal" should be deprecated or the module > mechanism needs to honor it. > > >> >> On Thu, Mar 4, 2021 at 3:34 AM 'Bryan C. Mills' via golang-nuts < >> golan...@googlegroups.com> wrote: >> >>> You should be able to use a `replace` directive to replace the full >>> path "github.com/Michael-F-Ellis/skeleton/internal/common" or similar. >> >> >> Using replace would still mean that a module doesn't work, when used as a >> library. Generally, I feel that `replace` is being used for more and more >> things it wasn't designed for, leading to more and more friction and >> problems. I don't think we should encourage more off-label uses. >> > > Agree. Replace in this instance feels like a hack. Don't get me wrong, I > like the concept behind go.mod and think it's generally a strong and useful > design. That being said, I also agree with the sentiment expressed in a > couple of other recent thread that the present implementation imposes a > burden on coders who want to quickly sketch and test ideas in a local > directory. It ought to be possible to progress at least a little way > beyond Hello World before needing an external repo. > > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/c7f87f45-b944-4f00-a6a6-ad3a8d1c5d4bn%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/c7f87f45-b944-4f00-a6a6-ad3a8d1c5d4bn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAEkBMfFgzzCsPh0ZDayZdaVKFbg6Mk2vat_n1ic9qfnh7GzsTg%40mail.gmail.com.