From f64880000452bfb55811243fbb066c5a0bb3c19f Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Fri, 15 May 2020 09:40:02 -0400 Subject: 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 --- internal/stdlib/stdlib.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/stdlib') 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] -- cgit v1.3-6-g1900