Joe, There's a good chance your diagnosis is correct -- my understanding is the path used in an import statement is required to match up with the module path in the 'module' directive in the imported module's go.mod file.
In general, I think some projects have switched back and forth between wanting to officially be known as something like 'gopkg.in/foo/bar.v1' vs. 'github/foo/bar', which then causes mismatches if clients are out of sync, which might be what is going on here. One thing you could try is something like 'go mod graph | grep github.com/go-resty/resty', or alternatively manually review the output of 'go mod graph' to see if you can find someone importing the github import path. (Longer discussion of the whether or not to use `module gopkg.in/foo.v1` as the name of your module here: https://github.com/russross/blackfriday/issues/491#issuecomment-425585276 ) --thepudds On Wednesday, October 24, 2018 at 7:01:04 PM UTC-4, Joseph Lorenzini wrote: > > > Hi all, > > I have a deeply nested dependency somewhere that depends on go-resty. When > I do a go list in my module, I see this error. > > go: github.com/go-resty/resty@v1.10.0: parsing go.mod: unexpected module > path "gopkg.in/resty.v1" > go: error loading module requirements > > I checked out goresty and it does have a go.mod: > > https://github.com/go-resty/resty/blob/v1.10.0/go.mod > > The module name is gopkg.in/resty.v1 > > So what I am guessing is that some packages have imported > github.com/go-resty/resty while others have imported gopkg.in/resty.v1. > If every package imported gopkg.in/resty.v1 then i suspect this would > just work since that's module name. I actually am not sure where in the > dependency tree this is occurring. It could be I am using package A which > depends on package B which requires package C and Package C is the one > importing github.com/go-resty/resty. > > I tried a replace directive and that did not work. > > replace ( > github.com/go-resty/resty => gopkg.in/resty.v1 v1.10.0 > ) > > Is there a recommended way to handle this? > > Thanks, > Joe > > > > -- 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.