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/pkgsite/cmd/pkgsite: document ignored items #65582

Closed
3052 opened this issue Feb 7, 2024 · 0 comments
Closed

x/pkgsite/cmd/pkgsite: document ignored items #65582

3052 opened this issue Feb 7, 2024 · 0 comments

Comments

@3052
Copy link

3052 commented Feb 7, 2024

Proposal Details

opening new issue since previous issue was closed in error.

Proposal Details

it seems currently items ignored by the pkgsite tool are not documented. I did this search:

\"\.\" \"internal\" \"testdata\"

here:

https://cs.opensource.google/go

from my own testing, a folder like this is built and indexed:

_hello

a folder like this is built, but optionally indexed:

internal

and these are not built or indexed:

.hello
testdata

I think this is it:

// ignoredByGoTool reports whether the given import path corresponds
// to a directory that would be ignored by the go tool.
//
// The logic of the go tool for ignoring directories is documented at
// https://golang.org/cmd/go/#hdr-Package_lists_and_patterns:
//
//      Directory and file names that begin with "." or "_" are ignored
//      by the go tool, as are directories named "testdata".
//
// However, even though `go list` and other commands that take package
// wildcards will ignore these, they can still be imported and used in
// working Go programs. We continue to ignore the "." and "testdata"
// cases, but we've seen valid Go packages with "_", so we accept those.

https://github.com/golang/pkgsite/blob/24c36df908d0532d634e80b2b0598474b661736a/internal/fetch/package.go#L270-L282

another user said behavior is same as here:

https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns

but as can be seen in the above code, thats not true regarding _

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

No branches or pull requests

4 participants