-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Couldn't load correct replaced go.mod file #3343
Comments
I can't quite duplicate the problem you're describing. I suspect some steps are missing from your reproduction instrucdtions.
|
@bhcleek sorry, i didn't make it clearly.
package main
import (
"log"
"github.com/hashicorp/consul/api"
)
func main() {
client, err := api.NewClient(&api.Config{
Address: "xxx",
})
// ...
}
// NewClient returns a new client
func NewClient(config *Config) (*Client, error) {
// bootstrap the config
defConfig := DefaultConfig()
// ...
} ProblemMy problem is when i try to So I dig a little deeper, found that vim-go is trying to load module github.com/hashicorp/consul/api
go 1.12
replace github.com/hashicorp/consul/sdk => ../sdk (❌ this is where replace goes wrong)
require (
github.com/hashicorp/consul/sdk v0.8.0
//...
) If I change the line to Thanks a lot for your help. |
What version of Go are you using? |
go version go1.17.6 darwin/amd64 |
Thank you. I was able to reproduce the problem you're seeing and have a fix nearly ready. |
@bhcleek Big help, Thanks a lot! |
example package
$GOPATH/pkg/mod/github.com/hashicorp/consul/[email protected]/go.mod
file contentproblem
after
go mod tidy
,$GOPATH/pkg/mod/github.com/hashicorp/consul/[email protected]/...
is created.after
:GoDef
jump into.../consul/[email protected]/xxx.go
file, vim-go tries to read.../consul/sdk/go.mod
, and.../consul/sdk/
is not exist, so it cause GoDoc, GoDef ... stop working.vim-go error message:
env:
vim v8.2.4100
vim-go a319aaf
gopls v0.7.4
The text was updated successfully, but these errors were encountered: