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
diff --git a/src/encoding/json/jsontext/export.go b/src/encoding/json/jsontext/export.go
index 0ecccad..92adc6f 100644
--- a/src/encoding/json/jsontext/export.go
+++ b/src/encoding/json/jsontext/export.go
@@ -12,6 +12,20 @@
"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
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |