Hi John, When using a replace target that is a local filepath, yes, the target does need to be a module (this is in effect simulated by the go tool when a "module" is fetched from a remote VCS in case a project is not a module).
That's fixed in the most simple cases by creating a go.mod file in the target directory, either: go mod init go mod init example.com/blah Depending on your workflow, you might also be interested in https://github.com/rogpeppe/gohack which was created to experiment with workflows around working on local module replace-ments. Thanks, Paul On Fri, 14 Sep 2018 at 15:08, John Shahid <jvsha...@gmail.com> wrote: > > > Ping. > > John Shahid <jvsha...@gmail.com> writes: > > > Hi all, > > > > Is there a way to use the go module `replace' directive for packages > > that don't have go.mod yet ? I tried doing that and I get the following > > error: > > > >> go: parsing ../pkg/go.mod: open /path/to/pkg/go.mod: no such file or > >> directory > > > > According to https://github.com/golang/go/issues/24110 it looks like > > this is the intended behavior. My question is why the go tool (e.g. go > > get) can deal with such package when downloading it from github and > > could give it a pseudo version without a go.mod file but refuses to when > > the source code is local. > > > > I'm happy to construct a sample github project to repro the issue if > > that is needed. > > > > Thanks, > > > > -js > > -- > 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. > For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.