You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both defaultImpl types.Importer (in Importer) and importer types.Importer (in TypesLoader) were initialized with importer.Default() but never subsequently read. Removing them has no behavioral impact on package resolution.
Positive effects
Correctness: The Importer.Import() fallback chain already terminates at ErrNotFoundPackage without ever consulting defaultImpl; TypesLoader.Import similarly never called .importer. Removal is safe.
Security: Eliminating go/importer.Default() as an implicit fallback removes a potential uncontrolled filesystem read. Package resolution is now fully explicit and controlled.
Performance: importer.Default() initializes the GC importer (path resolution, module layout, internal caches) eagerly on every NewImporter/NewTypesLoader call. Removing this unconditional startup cost is a net win.
Minor observations (out-of-diff, non-blocking)
context.go ~line 90 — The exported Importer field comment is just // importer. Now that go/importer.Default() is no longer a silent fallback, this field is the sole importer for the type checker and is always non-nil after NewContext. A brief godoc note to that effect would help callers who want to override it.
xgobuild/build.go ~line 42–46 — The StaticLoad comment refers to "dynamic ixgo.Importer" implying the removed go/importer.Default() backend was the "dynamic" part. With that backend gone from ixgo.Importer entirely, the dynamic/static framing is less clear. Worth revisiting for accuracy.
PR title clarity — go/importer as a host-side dependency of ixgo is removed, but the package remains available to guest programs via the pkg/go/importer/ export stubs. The distinction may be worth a one-line commit note to avoid confusion in the git history.
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request removes the usage of the go/importer package and the types.Importer fields from the Importer and TypesLoader structs, as well as their corresponding initializations in NewImporter and NewTypesLoader. I have no feedback to provide as there were no review comments.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.