[go-nuts] Re: With Go modules, is that possible to reference a package which hasn't gotten a module support
2019. július 10., szerda 11:00:48 UTC+2 időpontban Roman Gomoliako a következőt írta: > > thepudds, > > Thank you for the reply, thanks for the link! > > The follow-up question, what if the project isn't hosted anywhere yet? > Like, I have a module-opted package and it tries to use a local > module-unaware package. For a local module-aware package usage one would > use `replace` declaration. But I found it doesn't work for module-unaware > packages. Having the module-unaware anEnterpriseCompany.com/anotherProject > only > locally I can't ahieve a successfull compilation using `replace`: > > module anEnterpriseCompany.com/aProject > > require anEnterpriseCompany.com/anotherProject v0.0.0 > > replace anEnterpriseCompany.com/anotherProject => > ../some/where/up/on/a/filesystem/anotherProject > > go 1.12 > > > > On Tuesday, 9 July 2019 22:08:52 UTC+3, t hepudds wrote: >> >> >> Hi Roman, >> >> > For a project considering switching to Go modules, is that possible to >> > reference a package without support of modules (doesn't have a >> go.mod/go.sum files)? >> >> Yes, as far I understand, that should usually work. >> >> Using your example of wanting to consume a non-module dependency >> anEnterpriseCompany.com/anotherProject, a module-based consumer should be >> able to do things like: >> >> $ go get anEnterpriseCompany.com/anotherProject@ >> $ go get anEnterpriseCompany.com/anotherProject@ >> $ go get anEnterpriseCompany.com/anotherProject@latest >> >> There is a longer discussion in this FAQ on the Modules wiki: >> >> >> https://github.com/golang/go/wiki/Modules#can-a-module-consume-a-package-that-has-not-opted-in-to-modules >> >> Hope that helps, >> thepudds >> >> >> On Tuesday, July 9, 2019 at 9:21:48 AM UTC-4, Roman Gomoliako wrote: >>> >>> For a project considering switching to Go modules, is that possible to >>> reference a package without support of modules (doesn't have a >>> go.mod/go.sum files)? >>> >>> module anEnterpriseCompany.com/aProject >>> >>> require anEnterpriseCompany.com/anotherProject v0.0.0 >>> >>> go 1.12 >>> >>> "anEnterpriseCompany.com/anotherProject" can't be modified to support >>> Go modules for some internal reasons. Is there some ways to resolve this? >>> >>> Thanks, >>> >>> Roman >>> >> If it's on your local filesystem, you can easily add a go.mod file to it... -- 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/e791d0ce-dce0-491b-aebe-76019865bb66%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: With Go modules, is that possible to reference a package which hasn't gotten a module support
thepudds, Thank you for the reply, thanks for the link! The follow-up question, what if the project isn't hosted anywhere yet? Like, I have a module-opted package and it tries to use a local module-unaware package. For a local module-aware package usage one would use `replace` declaration. But I found it doesn't work for module-unaware packages. Having the module-unaware anEnterpriseCompany.com/anotherProject only locally I can't ahieve a successfull compilation using `replace`: module anEnterpriseCompany.com/aProject require anEnterpriseCompany.com/anotherProject v0.0.0 replace anEnterpriseCompany.com/anotherProject => ../some/where/up/on/a/filesystem/anotherProject go 1.12 On Tuesday, 9 July 2019 22:08:52 UTC+3, t hepudds wrote: > > > Hi Roman, > > > For a project considering switching to Go modules, is that possible to > > reference a package without support of modules (doesn't have a > go.mod/go.sum files)? > > Yes, as far I understand, that should usually work. > > Using your example of wanting to consume a non-module dependency > anEnterpriseCompany.com/anotherProject, a module-based consumer should be > able to do things like: > > $ go get anEnterpriseCompany.com/anotherProject@ > $ go get anEnterpriseCompany.com/anotherProject@ > $ go get anEnterpriseCompany.com/anotherProject@latest > > There is a longer discussion in this FAQ on the Modules wiki: > > > https://github.com/golang/go/wiki/Modules#can-a-module-consume-a-package-that-has-not-opted-in-to-modules > > Hope that helps, > thepudds > > > On Tuesday, July 9, 2019 at 9:21:48 AM UTC-4, Roman Gomoliako wrote: >> >> For a project considering switching to Go modules, is that possible to >> reference a package without support of modules (doesn't have a >> go.mod/go.sum files)? >> >> module anEnterpriseCompany.com/aProject >> >> require anEnterpriseCompany.com/anotherProject v0.0.0 >> >> go 1.12 >> >> "anEnterpriseCompany.com/anotherProject" can't be modified to support Go >> modules for some internal reasons. Is there some ways to resolve this? >> >> Thanks, >> >> Roman >> > -- 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/fc3af77b-2dee-420b-acd4-fcd3d4bbdf03%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Re: With Go modules, is that possible to reference a package which hasn't gotten a module support
Hi Roman, > For a project considering switching to Go modules, is that possible to > reference a package without support of modules (doesn't have a go.mod/go.sum files)? Yes, as far I understand, that should usually work. Using your example of wanting to consume a non-module dependency anEnterpriseCompany.com/anotherProject, a module-based consumer should be able to do things like: $ go get anEnterpriseCompany.com/anotherProject@ $ go get anEnterpriseCompany.com/anotherProject@ $ go get anEnterpriseCompany.com/anotherProject@latest There is a longer discussion in this FAQ on the Modules wiki: https://github.com/golang/go/wiki/Modules#can-a-module-consume-a-package-that-has-not-opted-in-to-modules Hope that helps, thepudds On Tuesday, July 9, 2019 at 9:21:48 AM UTC-4, Roman Gomoliako wrote: > > For a project considering switching to Go modules, is that possible to > reference a package without support of modules (doesn't have a > go.mod/go.sum files)? > > module anEnterpriseCompany.com/aProject > > require anEnterpriseCompany.com/anotherProject v0.0.0 > > go 1.12 > > "anEnterpriseCompany.com/anotherProject" can't be modified to support Go > modules for some internal reasons. Is there some ways to resolve this? > > Thanks, > > Roman > -- 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/44ea25f2-522d-46e3-9cbd-8746e015908e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.