Skip to content

Commit e7abfed

Browse files
committed
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>
1 parent 7da961d commit e7abfed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

godoc/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (s *handlerServer) registerWithMux(mux *http.ServeMux) {
4747
mux.Handle(s.pattern, s)
4848
}
4949

50-
// getPageInfo returns the PageInfo for a package directory abspath. If the
50+
// GetPageInfo returns the PageInfo for a package directory abspath. If the
5151
// parameter genAST is set, an AST containing only the package exports is
5252
// computed (PageInfo.PAst), otherwise package documentation (PageInfo.Doc)
5353
// is extracted from the AST. If there is no corresponding package in the

godoc/vfs/namespace.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ type mountedFS struct {
108108
new string
109109
}
110110

111-
// hasPathPrefix returns true if x == y or x == y + "/" + more
111+
// hasPathPrefix reports whether x == y or x == y + "/" + more.
112112
func hasPathPrefix(x, y string) bool {
113113
return x == y || strings.HasPrefix(x, y) && (strings.HasSuffix(y, "/") || strings.HasPrefix(x[len(y):], "/"))
114114
}

0 commit comments

Comments
 (0)