Are documenting internal packages necessary? #7

Closed
opened 2 months ago by FractalU · 1 comments

In the 'Some Major Bugs' issue I reported that packages containing either '\\', 'internal' or 'testdata' could savely be avoided as it's done in godoc. Now, I see document files for internal packages still being generated but not being listed in the index. I'm curious whether documenting internal packages could be avoided. It would be quite desirable as it saves about 40MB on 100MB go standard library documentation. I checked the links extensively and couldn't find any links that point to the internal packages. In exremely rare cases there might be links that do.

I made a cheap change in 'main.go' at line 375

from

"""
filterPkgs := pkgs

for _, pkg := range pkgs {
subPkgs := strings.Split(pkg, "/")
for i := range subPkgs {
pkgs = append(pkgs, strings.Join(subPkgs[0:i+1], "/"))
}
}
pkgs = filterPkgsWithExcludes(uniqueStrings(pkgs))
"""

to

"""
for _, pkg := range pkgs {
subPkgs := strings.Split(pkg, "/")
for i := range subPkgs {
pkgs = append(pkgs, strings.Join(subPkgs[0:i+1], "/"))
}
}
pkgs = filterPkgsWithExcludes(uniqueStrings(pkgs))

filterPkgs := pkgs
"""

I basically changed the position of the 'filterPkgs' variable. This is obviously a hack which is good enough for me. I'm curious whether it could be done properly.

In the 'Some Major Bugs' issue I reported that packages containing either '\\\\', 'internal' or 'testdata' could savely be avoided as it's done in godoc. Now, I see document files for internal packages still being generated but not being listed in the index. I'm curious whether documenting internal packages could be avoided. It would be quite desirable as it saves about 40MB on 100MB go standard library documentation. I checked the links extensively and couldn't find any links that point to the internal packages. In exremely rare cases there might be links that do. I made a cheap change in 'main.go' at line 375 from """ filterPkgs := pkgs for _, pkg := range pkgs { subPkgs := strings.Split(pkg, "/") for i := range subPkgs { pkgs = append(pkgs, strings.Join(subPkgs[0:i+1], "/")) } } pkgs = filterPkgsWithExcludes(uniqueStrings(pkgs)) """ to """ for _, pkg := range pkgs { subPkgs := strings.Split(pkg, "/") for i := range subPkgs { pkgs = append(pkgs, strings.Join(subPkgs[0:i+1], "/")) } } pkgs = filterPkgsWithExcludes(uniqueStrings(pkgs)) filterPkgs := pkgs """ I basically changed the position of the 'filterPkgs' variable. This is obviously a hack which is good enough for me. I'm curious whether it could be done properly.
tslocum referenced this issue from a commit 2 months ago
Owner

Thanks. I've added a flag in case anyone needs to preserve these packages.

Thanks. I've added a flag in case anyone needs to preserve these packages.
tslocum closed this issue 2 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.