internal: add support for std@dev.boringcrypto
Change-Id: Ibe5383c8c9b9ce771b677c2e33a0c2c85621df6d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343218
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/internal/frontend/versions.go b/internal/frontend/versions.go
index 7543fa4..a84d182 100644
--- a/internal/frontend/versions.go
+++ b/internal/frontend/versions.go
@@ -355,8 +355,9 @@
// std doesn't have actual pseudoversions, so the only ones we
// support are "master" and "dev.fuzz".
v := version.Master
- if requestedVersion == stdlib.DevFuzz {
- v = stdlib.DevFuzz
+ if requestedVersion == stdlib.DevFuzz ||
+ requestedVersion == stdlib.DevBoringCrypto {
+ v = requestedVersion
}
return fmt.Sprintf("%s (%s)", v, commit[0:7])
}
diff --git a/internal/stdlib/stdlib.go b/internal/stdlib/stdlib.go
index faa62a2..96ae3c5 100644
--- a/internal/stdlib/stdlib.go
+++ b/internal/stdlib/stdlib.go
@@ -40,6 +40,9 @@
// DevFuzz is the branch name for fuzzing in beta.
DevFuzz = "dev.fuzz"
+
+ // DevBoringCrypto is the branch name for dev.boringcrypto.
+ DevBoringCrypto = "dev.boringcrypto"
)
var (
@@ -54,8 +57,9 @@
// SupportedBranches are the branches of the stdlib repo supported by pkgsite.
var SupportedBranches = map[string]bool{
- version.Master: true,
- DevFuzz: true,
+ version.Master: true,
+ DevBoringCrypto: true,
+ DevFuzz: true,
}
// VersionForTag returns the semantic version for the Go tag, or "" if
@@ -199,8 +203,8 @@
var ref plumbing.ReferenceName
if v == version.Master {
ref = plumbing.HEAD
- } else if v == DevFuzz {
- ref = "refs/heads/dev.fuzz"
+ } else if SupportedBranches[v] {
+ ref = plumbing.NewBranchReferenceName(v)
} else {
tag, err := TagForVersion(v)
if err != nil {