aboutsummaryrefslogtreecommitdiff
path: root/internal/fetch/fetchdata_test.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2020-08-28 00:49:09 -0400
committerJulie Qiu <julie@golang.org>2020-08-28 14:25:20 +0000
commitdee9bdb3c8c2ae0b8cd19d16ebe646ca73068812 (patch)
tree054c45a601b8500ceea0415b36e2e4f32e42d0d2 /internal/fetch/fetchdata_test.go
parentdb8f07c3a29d8acc73cef9d7fa723b58ad5a9716 (diff)
downloadgo-x-pkgsite-dee9bdb3c8c2ae0b8cd19d16ebe646ca73068812.tar.xz
internal/postgres: add WithImports fieldset to GetDirectory
GetDirectory now supports the WithImports fieldset, which lets the caller fetch only the imports. The Package.Imports field is moved to Directory.Imports. For golang/go#39629. Change-Id: I5d597555fa372cc1ee70390460d349fa83f31425 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/251272 Reviewed-by: Jamal Carvalho <jamal@golang.org>
Diffstat (limited to 'internal/fetch/fetchdata_test.go')
-rw-r--r--internal/fetch/fetchdata_test.go82
1 files changed, 41 insertions, 41 deletions
diff --git a/internal/fetch/fetchdata_test.go b/internal/fetch/fetchdata_test.go
index 27401a70..ef3e970f 100644
--- a/internal/fetch/fetchdata_test.go
+++ b/internal/fetch/fetchdata_test.go
@@ -62,8 +62,8 @@ var moduleOnePackage = &testModule{
Documentation: &internal.Documentation{
Synopsis: "package foo exports a helpful constant.",
},
- Imports: []string{"net/http"},
},
+ Imports: []string{"net/http"},
},
},
},
@@ -156,8 +156,8 @@ var moduleMultiPackage = &testModule{
Synopsis: "package foo",
HTML: html("FooBar returns the string &#34;foo bar&#34;."),
},
- Imports: []string{"fmt", "github.com/my/module/bar"},
},
+ Imports: []string{"fmt", "github.com/my/module/bar"},
},
},
},
@@ -467,8 +467,8 @@ var moduleNonRedist = &testModule{
Synopsis: "package foo",
HTML: html("FooBar returns the string"),
},
- Imports: []string{"fmt", "github.com/my/module/bar"},
},
+ Imports: []string{"fmt", "github.com/my/module/bar"},
},
},
},
@@ -766,25 +766,25 @@ var moduleStd = &testModule{
Documentation: &internal.Documentation{
Synopsis: "Pprof interprets and displays profiles of Go programs.",
},
- Imports: []string{
- "cmd/internal/objfile",
- "crypto/tls",
- "debug/dwarf",
- "fmt",
- "github.com/google/pprof/driver",
- "github.com/google/pprof/profile",
- "golang.org/x/crypto/ssh/terminal",
- "io",
- "io/ioutil",
- "net/http",
- "net/url",
- "os",
- "regexp",
- "strconv",
- "strings",
- "sync",
- "time",
- },
+ },
+ Imports: []string{
+ "cmd/internal/objfile",
+ "crypto/tls",
+ "debug/dwarf",
+ "fmt",
+ "github.com/google/pprof/driver",
+ "github.com/google/pprof/profile",
+ "golang.org/x/crypto/ssh/terminal",
+ "io",
+ "io/ioutil",
+ "net/http",
+ "net/url",
+ "os",
+ "regexp",
+ "strconv",
+ "strings",
+ "sync",
+ "time",
},
},
{
@@ -797,8 +797,8 @@ var moduleStd = &testModule{
Documentation: &internal.Documentation{
Synopsis: "Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.",
},
- Imports: []string{"errors", "fmt", "reflect", "sync", "time"},
},
+ Imports: []string{"errors", "fmt", "reflect", "sync", "time"},
},
{
DirectoryMeta: internal.DirectoryMeta{
@@ -816,23 +816,23 @@ var moduleStd = &testModule{
Documentation: &internal.Documentation{
Synopsis: "Package json implements encoding and decoding of JSON as defined in RFC 7159.",
},
- Imports: []string{
- "bytes",
- "encoding",
- "encoding/base64",
- "errors",
- "fmt",
- "io",
- "math",
- "reflect",
- "sort",
- "strconv",
- "strings",
- "sync",
- "unicode",
- "unicode/utf16",
- "unicode/utf8",
- },
+ },
+ Imports: []string{
+ "bytes",
+ "encoding",
+ "encoding/base64",
+ "errors",
+ "fmt",
+ "io",
+ "math",
+ "reflect",
+ "sort",
+ "strconv",
+ "strings",
+ "sync",
+ "unicode",
+ "unicode/utf16",
+ "unicode/utf8",
},
},
{
@@ -852,12 +852,12 @@ var moduleStd = &testModule{
Path: "flag",
V1Path: "flag",
},
+ Imports: []string{"errors", "fmt", "io", "os", "reflect", "sort", "strconv", "strings", "time"},
Package: &internal.Package{
Name: "flag",
Documentation: &internal.Documentation{
Synopsis: "Package flag implements command-line flag parsing.",
},
- Imports: []string{"errors", "fmt", "io", "os", "reflect", "sort", "strconv", "strings", "time"},
},
},
},