aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/encode.go
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2025-05-19 15:31:37 -0400
committerMichael Matloob <matloob@golang.org>2025-05-20 13:30:32 -0700
commit546761aff45111490b21a045e3d989104182bcd9 (patch)
tree499d888cbf27adc764578e8f381e4da5306ff136 /src/encoding/json/encode.go
parent1972493904b41a34e35a1f62b18f5d91d84a26bd (diff)
downloadgo-546761aff45111490b21a045e3d989104182bcd9.tar.xz
cmd/doc: use go list to determine import path if it's missing
cmd/doc uses go/build to get information about the packages it's documenting. In some cases, go/build can return a build.Package that it couldn't determine an import path for, in which case it sets the import path to ".". This can happen for relative package paths in in a module: for relative package paths we don't use the go command to get information about the module and just open the source files directly instead, and will be missing the import path. This is usually okay because go doc doesn't need to print the import path of the package it's documenting, but for go doc -http, we want to know the import path so we can open the right page in the browser. For #68106 Change-Id: Ifba92862ad01d8d63f531c2451f18db2b0d7a3e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/674556 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Michael Matloob <matloob@google.com>
Diffstat (limited to 'src/encoding/json/encode.go')
0 files changed, 0 insertions, 0 deletions