commit | 03963f5f94ce78645d3d3b07edfd752d71a6c720 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Fri Sep 25 17:11:39 2020 -0400 |
committer | Jonathan Amsterdam <jba@google.com> | Tue Sep 29 12:56:24 2020 +0000 |
tree | db7e70a99f47bcf0a94a209423eefcd53431d04b | |
parent | 6eff568230f00146123c9ac392f3ddc4271ce446 [diff] |
internal/fetch: convert ast.Files to and from bytes Add a pair of functions to encode and decode ast.Files. We'll use these to store the files in the DB so we can generate documentation on the frontend. Originally we stored the full source in a zip file. That turned out to be too slow. Then we tried to remove unexported functions and function bodies from the source before saving it. The problem is that doing so changes the line numbers, so the source links in the rendered doc point to the wrong lines. We could perhaps fix that by inserting "//line" compiler directives in the right places, but it would be tricky. Instead, we just encode the AST directly, using gob. Gob doesn't handle cycles, but the fields that are responsible for the cycles aren't needed for doc generation anyway. It is important to get the ast.Object pointers right, so we do that. Change-Id: I79f49b125adfc4e516f0aea6ad91cd5259b3d012 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/257757 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Pkg.go.dev is a website for discovering and evaluating Go packages and modules.
You can check it out at https://pkg.go.dev.
Pkg.go.dev launched in November 2019, and is currently under active development by the Go team.
Here's what we are currently working on:
Design updates: We have some design changes planned for pkg.go.dev, to address UX feedback that we have received. You can expect a more cohesive search and navigation experience coming soon. We plan to share these designs for feedback once they are ready.
Godoc.org redirect: Longer term, we are working towards redirecting godoc.org traffic to pkg.go.dev. We know that there are features available on godoc.org that users want to see on pkg.go.dev, and we want to ensure that we address these. We’ve been keeping track of issues related to redirecting godoc.org traffic on Go issue #39144. These issues will be prioritized in the next few months. We also plan to continue improving our license detection algorithm.
Search improvements: We’ll be improving our search experience based on feedback in Go issue #37810, to make it easier for users to find the dependencies they are looking for and make better decisions around which ones to import.
We encourage everyone to begin using pkg.go.dev today for all of their needs and to file feedback! You can redirect all of your requests from godoc.org to pkg.go.dev, by clicking Always use pkg.go.dev
at the top of any page on godoc.org.
If you want to report a bug or have a feature suggestion, please first check the known issues to see if your issue is already being discussed. If an issue does not already exist, feel free to file an issue.
For answers to frequently asked questions, see go.dev/about.
You can also chat with us on the #tools slack channel on the Gophers slack.
We would love your help!
Our canonical Git repository is located at go.googlesource.com/pkgsite. There is a mirror of the repository at github.com/golang/pkgsite.
To contribute, please read our contributing guide.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.