aboutsummaryrefslogtreecommitdiff
path: root/internal/stdlib
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2020-05-15 09:40:02 -0400
committerJonathan Amsterdam <jba@google.com>2020-05-18 16:14:14 +0000
commitf64880000452bfb55811243fbb066c5a0bb3c19f (patch)
tree77c279ebef841f8521f17d08584e7b2c535b0afa /internal/stdlib
parentc4fb18e37095ab58e8b951a63ada706c764cb957 (diff)
downloadgo-x-pkgsite-f64880000452bfb55811243fbb066c5a0bb3c19f.tar.xz
internal/stdlib: clarify doc comment for Contains
Change-Id: Ic17226b2ae53e17ed96ee288e29306845252b3e8 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/747785 Reviewed-by: Julie Qiu <julieqiu@google.com>
Diffstat (limited to 'internal/stdlib')
-rw-r--r--internal/stdlib/stdlib.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/stdlib/stdlib.go b/internal/stdlib/stdlib.go
index ba3033c7..34151b87 100644
--- a/internal/stdlib/stdlib.go
+++ b/internal/stdlib/stdlib.go
@@ -395,7 +395,8 @@ func subTree(r *git.Repository, t *object.Tree, name string) (*object.Tree, erro
return nil, os.ErrNotExist
}
-// Contains reports whether the given import path is part of the Go standard library.
+// Contains reports whether the given import path could be part of the Go standard library,
+// by reporting whether the first component lacks a '.'.
func Contains(path string) bool {
if i := strings.IndexByte(path, '/'); i != -1 {
path = path[:i]