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: panic in FillStruct with invalid fields #63921

Closed
findleyr opened this issue Nov 3, 2023 · 4 comments
Closed

x/tools/gopls: panic in FillStruct with invalid fields #63921

findleyr opened this issue Nov 3, 2023 · 4 comments
Assignees
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Nov 3, 2023

Filling S{} panics here:

type S struct {
  F int
  E
}

func_() {
  S{}
}

...due to S having invalid fields. Add tests and fix.

@findleyr findleyr added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels Nov 3, 2023
@findleyr findleyr added this to the gopls/v0.15.0 milestone Nov 3, 2023
@Oguidan
Copy link

Oguidan commented Nov 3, 2023

The problem is with "E" bro

@findleyr
Copy link
Contributor Author

findleyr commented Nov 3, 2023

@Oguidan yes, E is not defined. The problem is that gopls panics. gopls should not panic, even when the code being edited is invalid.

@Oguidan
Copy link

Oguidan commented Nov 4, 2023

But @findleyr , you know that Golang is garbage collector!

@findleyr findleyr self-assigned this Dec 12, 2023
@gopherbot
Copy link

Change https://go.dev/cl/549116 mentions this issue: gopls/internal/analysis/fillstruct: don't panic with invalid fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants