This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API docs: do not panic on missing type information from obscure main-…
…exported types (#185) * API docs: do not panic on missing type information from obscure main-exported types Prior to this change, we would panic (nil pointer deref) in the event that we encounter an exported type inside of a `package main` (which is non-sensical and a linter error in Go): ``` package main type Foo struct{} func main() {} ``` This may be a bug in `go/packages`, since we are able to pick up type information for the `main` symbol itself (ironic!) - but I'm not sure. For now, at least don't panic / fail to index everything else. Signed-off-by: Stephen Gutekanst <[email protected]>
- Loading branch information
Stephen Gutekanst
authored
Jul 29, 2021
1 parent
9aa5f44
commit c0312b8
Showing
5 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package main | ||
|
||
type User struct { | ||
Id, Name string | ||
} | ||
|
||
type UserResource struct{} | ||
|
||
func main() {} |