[go] encoding/json/jsontext: add TODO about removing Internal symbol

0 views
Skip to first unread message

Joseph Tsai (Gerrit)

unread,
2:03 AM (3 hours ago) 2:03 AM
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Joseph Tsai has uploaded the change for review

Commit message

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

Change diff

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

Change information

Files:
  • M src/encoding/json/jsontext/export.go
Change size: S
Delta: 1 file changed, 14 insertions(+), 0 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ibd81967419e6daceb1377b0bfa3fc54536a4fce1
Gerrit-Change-Number: 771860
Gerrit-PatchSet: 1
Gerrit-Owner: Joseph Tsai <joe...@digital-static.net>
unsatisfied_requirement
satisfied_requirement
open
diffy

Joseph Tsai (Gerrit)

unread,
2:04 AM (3 hours ago) 2:04 AM
to goph...@pubsubhelper.golang.org, Damien Neil, Michael Pratt, Johan Brandhorst-Satzkorn, Daniel Martí, golang-co...@googlegroups.com
Attention needed from Damien Neil, Daniel Martí, Johan Brandhorst-Satzkorn and Michael Pratt

Joseph Tsai voted

Auto-Submit+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Damien Neil
  • Daniel Martí
  • Johan Brandhorst-Satzkorn
  • Michael Pratt
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ibd81967419e6daceb1377b0bfa3fc54536a4fce1
Gerrit-Change-Number: 771860
Gerrit-PatchSet: 1
Gerrit-Owner: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Daniel Martí <mv...@mvdan.cc>
Gerrit-Reviewer: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
Gerrit-Reviewer: Joseph Tsai <joe...@digital-static.net>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Michael Pratt <mpr...@google.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Attention: Johan Brandhorst-Satzkorn <johan.br...@gmail.com>
Gerrit-Attention: Daniel Martí <mv...@mvdan.cc>
Gerrit-Comment-Date: Wed, 29 Apr 2026 06:04:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages