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: some build errors aren't reported #43816

hyangah opened this issue Jan 20, 2021 · 0 comments

x/tools/gopls: some build errors aren't reported #43816

hyangah opened this issue Jan 20, 2021 · 0 comments


Copy link

@hyangah hyangah commented Jan 20, 2021

go version: go1.16beta1
gopls version: v0.6.4

how to repro

$ tree
├── [id].go
├── go.mod
└── lib
    └── a
        └── a.go

2 directories, 3 files

$ cat go.mod
module work

go 1.15

$ cat [id].go
package main

import "work/lib/a"

func main() {

$ cat lib/a/a.go
package a

var V = "Searching all the dark corners for every foot gun we can get our tentacles on..."

The go command is unhappy about the file name [id].go

$ go build
package work: invalid input file name "[id].go"

What I expected to see

gopls detects the problem and reports it as diagnostic message.

What I saw instead

gopls doesn't report any error.

Things get more confusing if we rename the lib directory to _lib directory.
Now gopls reports a compiler error, but that's not about the file name.
Screen Shot 2021-01-20 at 6 26 47 PM

Finally, if I fixed the file name - rename [id].go to id.go (but kept using _lib directory) , the error message disappear and go build also succeeds.

@gopherbot gopherbot added this to the Unreleased milestone Jan 20, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Jan 21, 2021
@stamblerre stamblerre added this to To Do in gopls: v1.0.0 Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants