Skip to content

load std package list to check if a package is a really "std" lib #208

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yin1999
Copy link

@yin1999 yin1999 commented Apr 30, 2025

Previously, the program determined whether a package was a std package by checking if there was a dot(".") in its package path. This method could easily lead to some local packages that didn’t follow that naming convention also being identified as std packages. The golang.org/x/tools/go/packages module supports loading "std" packages (an example), which can be used to load all standard packages and determine whether a package is a std package by checking for its existence.

Copy link
Collaborator

@ondrej-fabry ondrej-fabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants