/ go Public
bytes, strings: should have minimal dependency on unicode #54098
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Importing "unicode" immediately bloats a binary by ~100k. This is unfortunately unavoidable since the
unicode.Categoriesmap contains a reference to every Unicode category in existence (see #7600 or #2559).
We should make it such that only referencing
bytes.HasPrefix) that do not depend on
unicodeshould not result in
unicodebeing linked into the binary.
Here's a list of functions that depend on
Of all of these, only
TrimSpaceare used to any significant degree. Even still, the implementation of
unicode.IsSpaceis fairly small and references a relatively small table.
Perhaps we should create a
internal/unicodetablespackage that contains every table. The
unicodepackage can depend on
unicodetables, and other stdlib packages can depend on
The text was updated successfully, but these errors were encountered: