]> Cypherpunks repositories - gostls13.git/commit
go/doc: NewFromFiles: fix panic on Files with SkipObjectResolution
authorAlan Donovan <adonovan@google.com>
Wed, 21 May 2025 15:21:31 +0000 (11:21 -0400)
committerAlan Donovan <adonovan@google.com>
Thu, 29 May 2025 15:18:49 +0000 (08:18 -0700)
commitf8c51b1a6c3d6ebfdbeab3c81d4157aefe0e8b71
treee56e053133d2c21f954a4b699fa6fcde224c2b48
parent263bc50c90ff8e0bcd55765819056807acfd20ab
go/doc: NewFromFiles: fix panic on Files with SkipObjectResolution

This CL fixes a panic in NewFromFiles when it is provided files
produced by the parser in SkipObjectResolution mode, which skips
the step of connecting ast.Idents to (deprecated) ast.Objects.
Instead of calling ast.NewPackage, which performs a number of
unnecessary steps, we just construct the ast.Package directly.

Fixes #66290

Change-Id: Id55bd30d8afb9d396c3901070e7607c5a22030d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/675036
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/go/doc/doc.go
src/go/doc/example_test.go