aboutsummaryrefslogtreecommitdiff
path: root/internal/testing/sample/sample.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2020-10-24 11:30:13 -0400
committerJonathan Amsterdam <jba@google.com>2020-10-26 13:53:34 +0000
commit4bf4c1e8b614f14914c0f20a5aeed9c6e3afba45 (patch)
treecf933838e5ab2bae4306fb6b65ce42ee28e1ff27 /internal/testing/sample/sample.go
parent244535af9dc4b75ff3d387c93e35c60467cbf85e (diff)
downloadgo-x-pkgsite-4bf4c1e8b614f14914c0f20a5aeed9c6e3afba45.tar.xz
internal/{frontend,postgres,testing}: set unit.NumImports
Set the NumImports field whenever we set Imports. Fixes b/171487247 Change-Id: I144fc2c36503c204712c694e0ff8a6ea4ece4bfb Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264860 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/testing/sample/sample.go')
-rw-r--r--internal/testing/sample/sample.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go
index 144ce29b..c35cde00 100644
--- a/internal/testing/sample/sample.go
+++ b/internal/testing/sample/sample.go
@@ -151,6 +151,7 @@ func UnitForPackage(path, modulePath, version, name string, isRedistributable bo
},
LicenseContents: Licenses,
Imports: Imports,
+ NumImports: len(Imports),
}
}