mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
godoc, godoc/vfs: improve documentation of GetPageInfo, hasPathPrefix
Change GetPageInfo method documentation to match the method name. Prefer using "reports whether" in a function that returns a boolean. This style is more idiomatic. Updates golang/go#33655 Change-Id: I1a781e7b4f5b4b629fdf4f48e2e97183f63508f9 Reviewed-on: https://go-review.googlesource.com/c/tools/+/196977 Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
This commit is contained in:
parent
7da961ddcf
commit
e7abfedfab
@ -47,7 +47,7 @@ func (s *handlerServer) registerWithMux(mux *http.ServeMux) {
|
|||||||
mux.Handle(s.pattern, s)
|
mux.Handle(s.pattern, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// getPageInfo returns the PageInfo for a package directory abspath. If the
|
// GetPageInfo returns the PageInfo for a package directory abspath. If the
|
||||||
// parameter genAST is set, an AST containing only the package exports is
|
// parameter genAST is set, an AST containing only the package exports is
|
||||||
// computed (PageInfo.PAst), otherwise package documentation (PageInfo.Doc)
|
// computed (PageInfo.PAst), otherwise package documentation (PageInfo.Doc)
|
||||||
// is extracted from the AST. If there is no corresponding package in the
|
// is extracted from the AST. If there is no corresponding package in the
|
||||||
|
@ -108,7 +108,7 @@ type mountedFS struct {
|
|||||||
new string
|
new string
|
||||||
}
|
}
|
||||||
|
|
||||||
// hasPathPrefix returns true if x == y or x == y + "/" + more
|
// hasPathPrefix reports whether x == y or x == y + "/" + more.
|
||||||
func hasPathPrefix(x, y string) bool {
|
func hasPathPrefix(x, y string) bool {
|
||||||
return x == y || strings.HasPrefix(x, y) && (strings.HasSuffix(y, "/") || strings.HasPrefix(x[len(y):], "/"))
|
return x == y || strings.HasPrefix(x, y) && (strings.HasSuffix(y, "/") || strings.HasPrefix(x[len(y):], "/"))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user