internal/source: fix documentation
source.ModuleInfo is incorrectly documented as source.LegacyModuleInfo,
which is now fixed.
A comment in RawURL is also fixed.
For golang/go#39629
Change-Id: I30b650f2895970e36446659a02a6f3e8e54ef578
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/258301
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Trust: Julie Qiu <julie@golang.org>
diff --git a/internal/source/source.go b/internal/source/source.go
index e017dce..c1981ec 100644
--- a/internal/source/source.go
+++ b/internal/source/source.go
@@ -126,8 +126,8 @@
// Special case: the standard library's source module path is set to "src",
// which is correct for source file links. But the README is at the repo
// root, not in the src directory. In other words,
- // VersionInfo.LegacyReadmeFilePath is not relative to
- // VersionInfo.SourceInfo.moduleDir, as it is for every other module.
+ // Module.Units[0].Readme.FilePath is not relative to
+ // Module.Units[0].SourceInfo.moduleDir, as it is for every other module.
// Correct for that here.
if i.repoURL == stdlib.GoSourceRepoURL {
moduleDir = ""
@@ -242,14 +242,14 @@
return resp, nil
}
-// LegacyModuleInfo determines the repository corresponding to the module path. It
+// ModuleInfo determines the repository corresponding to the module path. It
// returns a URL to that repo, as well as the directory of the module relative
// to the repo root.
//
-// LegacyModuleInfo may fetch from arbitrary URLs, so it can be slow.
+// ModuleInfo may fetch from arbitrary URLs, so it can be slow.
func ModuleInfo(ctx context.Context, client *Client, modulePath, version string) (info *Info, err error) {
- defer derrors.Wrap(&err, "source.LegacyModuleInfo(ctx, %q, %q)", modulePath, version)
- ctx, span := trace.StartSpan(ctx, "source.LegacyModuleInfo")
+ defer derrors.Wrap(&err, "source.ModuleInfo(ctx, %q, %q)", modulePath, version)
+ ctx, span := trace.StartSpan(ctx, "source.ModuleInfo")
defer span.End()
if modulePath == stdlib.ModulePath {