]> Cypherpunks repositories - gostls13.git/commit
cmd/doc: fix -http on Windows
authorqmuntal <quimmuntal@gmail.com>
Fri, 27 Jun 2025 10:45:22 +0000 (12:45 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Sun, 29 Jun 2025 14:01:25 +0000 (07:01 -0700)
commitacb914f2c2a3ec3dd227812ba6b119480d6400cd
tree6018c6e80afa0830ee306608e4a2377f8f9739dc
parentb51f1cdb8752c2fdd6a2bf06224aab0b5c07caac
cmd/doc: fix -http on Windows

On Windows, GOMODCACHE almost never starts with a slash, and
"go doc -http" constructs a GOPROXY URL by doing "file://" + GOMODCACHE,
resulting in an invalid file URI.

For example, if GOMODCACHE is "C:\foo", then the file URI should be
"file:///C:/foo", but it becomes "file://C:/foo" instead, where "C:" is
understood as a host name, not a drive letter.

Fixes #74137.

Change-Id: I23e776e0f649a0062e01d1a4a6ea8268ba467331
Reviewed-on: https://go-review.googlesource.com/c/go/+/684575
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/doc/doc.go
src/cmd/internal/doc/main.go