We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97b52a8 commit c0e0604Copy full SHA for c0e0604
internal/lsp/template/parse.go
@@ -28,6 +28,7 @@ import (
28
"golang.org/x/tools/internal/lsp/protocol"
29
"golang.org/x/tools/internal/lsp/source"
30
"golang.org/x/tools/internal/span"
31
+ errors "golang.org/x/xerrors"
32
)
33
34
var (
@@ -86,6 +87,10 @@ func parseBuffer(buf []byte) *Parsed {
86
87
buf: buf,
88
check: -1,
89
}
90
+ if len(buf) == 0 {
91
+ ans.ParseErr = errors.New("empty buffer")
92
+ return ans
93
+ }
94
// how to compute allAscii...
95
for _, b := range buf {
96
if b >= utf8.RuneSelf {
0 commit comments