Skip to content

Commit 82a2ef2

Browse files
bugfix
1 parent 5e05fb0 commit 82a2ef2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gopls/internal/cmd/cmd.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,11 @@ func (c *cmdClient) openFiles(uri protocol.DocumentURI) ([]*cmdFile, error) {
807807
if err != nil {
808808
return nil, err
809809
}
810-
files := make([]*cmdFile, len(entries))
811-
for i, e := range entries {
812-
files[i] = c.getFile(protocol.DocumentURI(filepath.Join(string(uri), e.Name())))
810+
files := make([]*cmdFile, 0)
811+
for _, e := range entries {
812+
if !e.IsDir() {
813+
files = append(files, c.getFile(protocol.DocumentURI(filepath.Join(string(uri), e.Name()))))
814+
}
813815
}
814816

815817
return files, nil

0 commit comments

Comments
 (0)