Skip to content
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

x/tools/gopls: rejects modules ending in /v1 #44046

Closed
juancer opened this issue Feb 1, 2021 · 4 comments
Closed

x/tools/gopls: rejects modules ending in /v1 #44046

juancer opened this issue Feb 1, 2021 · 4 comments

Comments

@juancer
Copy link

@juancer juancer commented Feb 1, 2021

What version of Go are you using (go version)?

$ go version
go version go1.15.7 windows/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\user\AppData\Local\go-build
set GOENV=C:\Users\jcervantes\AppData\Roaming\go\env  
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\user\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\user\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\AppServ\www\xxx\yyy\zzz\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\User~1\AppData\Local\Temp\go-build933812622=/tmp/go-build -gno-record-gcc-switches

What did you do?

My temporal gopls file:

module gopls-workspace

require mywebsite.online/v1 v0.0.0-goplsworkspace

replace mywebsite.online/v1 => C:\AppServ\www\xxx\yyy\zzz

Vscode Version:

1.52.1
ea3859d4ba2f3e577a159bc91e3074c5d85c0523
x64

gopls -v version

Build info
----------
golang.org/x/tools/gopls v0.6.4
    golang.org/x/tools/gopls@v0.6.4 h1:PO8rURGmi+QEKZ3pk+ZXJh51EFTVTSXqxzoRzrGSTJM=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/go-cmp@v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
    golang.org/x/sync@v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
    golang.org/x/sys@v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
    golang.org/x/tools@v0.1.1-0.20210119222907-0a1a9685734a h1:ttr/sghFptib3jlHwNS65KwGoqjr03TFzso3kpHyia8=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
    mvdan.cc/gofumpt@v0.1.0 h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

Go settings in vscode:

"go.languageServerFlags": [
        "-rpc.trace",
    ],
    "gopls": {
        "codelenses": {
        "generate": false,
        "gc_details": true
        }
    }

What did you expect to see?

Should be working, no?, well, no... :(

What did you see instead?

Error loading workspace: C:\Users\user~1\AppData\Local\Temp\gopls-workspace-mod684399923\go.mod:3: invalid module path C:\Users\user~1\AppData\Local\Temp\gopls-workspace-mod684399923\go.mod:5: replace mywebsite.online/v1: invalid module path
@seankhliao seankhliao changed the title Error loading workspace x/tools/gopls: rejects modules ending in /v1 Feb 1, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 1, 2021
@heschi
Copy link
Contributor

@heschi heschi commented Feb 1, 2021

Modules cannot be named ending with /v1, so if you've named your module that way, this is working intended. Otherwise, please follow the troubleshooting guide and upload a verbose log.

@juancer
Copy link
Author

@juancer juancer commented Feb 1, 2021

hi @heschik, I already tried with website.online and I got the same error. Could you provide me an example to test it please.

Best

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 2, 2021

@juancer: Can you please make sure that you reload your VS Code window after you changed the name of your module? If that still doesn't fix the issue, please share your logs as per the troubleshooting guide.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/unplanned Feb 2, 2021
@juancer
Copy link
Author

@juancer juancer commented Feb 2, 2021

hi @heschik and @stamblerre, thank you for your help, the solution of the situation is: the name of the module must be the same of the folder, example: "github.com/user/project" the module must be "website.com/project" wtih this configuration, gopls works perfectly.
Regards

@juancer juancer closed this Feb 2, 2021
@stamblerre stamblerre removed this from the gopls/unplanned milestone Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants