Are documenting internal packages necessary? #7

Closed
opened 2021-09-27 22:48:07 +00:00 by FractalU · 1 comment
Contributor

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 2021-10-06 02:07:49 +00:00
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.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tslocum/godoc-static#7
No description provided.