mirror of
https://github.com/golang/go.git
synced 2026-06-27 19:30:52 +00:00
encoding/json/jsontext: add TODO about removing Internal symbol
The Internal symbol is a hack that exposes certain symbols with module-only visibility. The correct solution is to use type aliases, but unfortunately the Go pkgsite lacks good support for rendering documentation for forwarded symbols such as methods and fields. Add TODO to eventually remove this hack. Updates #73435 Change-Id: Ibd81967419e6daceb1377b0bfa3fc54536a4fce1 Reviewed-on: https://go-review.googlesource.com/c/go/+/771860 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Joseph Tsai <joetsai@digital-static.net> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
f2ec1254ff
commit
60eb90e6b0
1 changed files with 14 additions and 0 deletions
|
|
@ -12,6 +12,20 @@ import (
|
|||
"encoding/json/internal"
|
||||
)
|
||||
|
||||
// TODO(https://go.dev/issue/73435): Remove the Internal symbol.
|
||||
//
|
||||
// The Go language lacks a 3rd category of visibility where
|
||||
// certain symbols can only be referenced from within the same module.
|
||||
// One solution to this is to put the entirety of a package with
|
||||
// both public and module-only symbols exposed as an internal package.
|
||||
// A separate, public package can re-export all of the public symbols
|
||||
// via type aliases and thus ensuring module-only symbols cannot be
|
||||
// referenced by the end-user. While this works, it unfortunately
|
||||
// leads to a poor user experience since the Go pkgsite is unable to
|
||||
// forward the documentation for symbols like methods and fields.
|
||||
// We need to improve the pkgsite experience before we can delete
|
||||
// the Internal symbol.
|
||||
|
||||
// Internal is for internal use only.
|
||||
// This is exempt from the Go compatibility agreement.
|
||||
var Internal exporter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue