From: Jes Cok Date: Tue, 12 Sep 2023 22:43:28 +0000 (+0000) Subject: go/doc/comment: update TODO for isStdPkg X-Git-Tag: go1.22rc1~870 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0460c61e5fd2242d27451f527dafc4d9a098fef4;p=gostls13.git go/doc/comment: update TODO for isStdPkg Even better is slices.BinarySearch, leave a TODO to update to that when possible. Change-Id: Ie1ec75c34c0329c536725b45e520693790f0520e GitHub-Last-Rev: 6cd811b186c95752794cead3ae747f54c2d0d0c5 GitHub-Pull-Request: golang/go#62585 Reviewed-on: https://go-review.googlesource.com/c/go/+/527341 LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor Reviewed-by: Robert Griesemer Auto-Submit: Ian Lance Taylor --- diff --git a/src/go/doc/comment/parse.go b/src/go/doc/comment/parse.go index 62a0f8f2bb..7b60e7ad5b 100644 --- a/src/go/doc/comment/parse.go +++ b/src/go/doc/comment/parse.go @@ -260,8 +260,7 @@ func (d *parseDoc) lookupPkg(pkg string) (importPath string, ok bool) { } func isStdPkg(path string) bool { - // TODO(rsc): Use sort.Find once we don't have to worry about - // copying this code into older Go environments. + // TODO: Use slices.BinarySearch when possible. i := sort.Search(len(stdPkgs), func(i int) bool { return stdPkgs[i] >= path }) return i < len(stdPkgs) && stdPkgs[i] == path }