diff options
| author | Hana Kim <hyangah@gmail.com> | 2026-03-05 22:47:31 -0500 |
|---|---|---|
| committer | Hyang-Ah Hana Kim <hyangah@gmail.com> | 2026-03-26 14:11:32 -0700 |
| commit | 98258ff769bbca6f3d004ce80fabf5bff8f1136c (patch) | |
| tree | 1ff3dccebdfc2df17009088688a1575383f68a42 /internal/stdlib/stdlib.go | |
| parent | 34edebc0803b121acd1cbf363eef074e0a13ab6d (diff) | |
| download | go-x-pkgsite-98258ff769bbca6f3d004ce80fabf5bff8f1136c.tar.xz | |
all: run go fix -slicescontains
Change-Id: I14479d9e612dfa7eed9188206746af5b51c10201
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753428
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'internal/stdlib/stdlib.go')
| -rw-r--r-- | internal/stdlib/stdlib.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/stdlib/stdlib.go b/internal/stdlib/stdlib.go index 1579f83a..c151febd 100644 --- a/internal/stdlib/stdlib.go +++ b/internal/stdlib/stdlib.go @@ -20,6 +20,7 @@ import ( "path" "path/filepath" "regexp" + "slices" "strings" "sync" "time" @@ -458,10 +459,8 @@ func semanticVersion(requestedVersion string) (_ string, err error) { } return latestVersion, nil default: - for _, v := range knownVersions { - if v == requestedVersion { - return requestedVersion, nil - } + if slices.Contains(knownVersions, requestedVersion) { + return requestedVersion, nil } } |
