diff options
| author | Julie Qiu <julie@golang.org> | 2021-05-05 20:28:16 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2021-05-06 17:43:23 +0000 |
| commit | 5eed0f6bc950ef849537ae0634849e8e48e683c9 (patch) | |
| tree | f41eb319dfa59384abe89cbdc416c3094edcd7b0 /internal/testing | |
| parent | 4e95d3e1ae115221102ced713bbd139cfe4e3c98 (diff) | |
| download | go-x-pkgsite-5eed0f6bc950ef849537ae0634849e8e48e683c9.tar.xz | |
internal/frontend: support displaying multiple of same type
Previously on the versions page, we were not handling the case when
different identifiers are added for the same type for different build
contexts, and which build context was surfaced was based on chance.
To support this case, it is now possible to show multiple of the same
type at the same version. For example,
https://pkg.go.dev/internal/poll?tab=versions at go1.10 will show:
```
type FD — windows/amd64
+ func (fd *FD) ReadMsg(p []byte, oob []byte) (int, int, int, syscall.Sockaddr, error)
+ func (fd *FD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (int, int, error)
type FD — darwin/amd64, linux/amd64
+ func (fd *FD) SetBlocking() error
+ func (fd *FD) WriteOnce(p []byte) (int, error)
```
For golang/go#37102
Change-Id: I19e6ef12f1f8f9c412aab7cea2782409eecf29f9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317489
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/testing')
| -rw-r--r-- | internal/testing/integration/data_frontend_versions_test.go | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/internal/testing/integration/data_frontend_versions_test.go b/internal/testing/integration/data_frontend_versions_test.go index 83df4279..b889c9d3 100644 --- a/internal/testing/integration/data_frontend_versions_test.go +++ b/internal/testing/integration/data_frontend_versions_test.go @@ -119,6 +119,44 @@ var versionsPageMultiGoos = []*frontend.VersionList{ Builds: []string{"js/wasm"}, }, }, + { + { + Name: "FD", + Synopsis: "type FD", + Section: "Types", + Kind: "Type", + Link: "/example.com/symbols@v1.2.0/multigoos?GOOS=darwin#FD", + Children: []*frontend.Symbol{ + { + Name: "FD.MyMethod", + Synopsis: "func (*FD) MyMethod()", + Section: "Types", + Kind: "Method", + Link: "/example.com/symbols@v1.2.0/multigoos?GOOS=darwin#FD.MyMethod", + New: true, + }, + }, + Builds: []string{"darwin/amd64", "linux/amd64"}, + }, + { + Name: "FD", + Synopsis: "type FD", + Section: "Types", + Kind: "Type", + Link: "/example.com/symbols@v1.2.0/multigoos?GOOS=windows#FD", + Children: []*frontend.Symbol{ + { + Name: "FD.MyWindowsMethod", + Synopsis: "func (*FD) MyWindowsMethod()", + Section: "Types", + Kind: "Method", + Link: "/example.com/symbols@v1.2.0/multigoos?GOOS=windows#FD.MyWindowsMethod", + New: true, + }, + }, + Builds: []string{"windows/amd64"}, + }, + }, }, }, { @@ -149,6 +187,17 @@ var versionsPageMultiGoos = []*frontend.VersionList{ Builds: []string{"darwin/amd64", "linux/amd64"}, }, }, + { + { + Name: "FD", + Synopsis: "type FD struct", + Section: "Types", + Kind: "Type", + Link: "/example.com/symbols@v1.1.0/multigoos?GOOS=darwin#FD", + Builds: []string{"darwin/amd64", "linux/amd64", "windows/amd64"}, + New: true, + }, + }, }, }, }, |
