Open
Description
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() {
println(a.V)
}
$ 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.
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.