Go unicode: test properties of Unicode code points
Answer: Package unicode provides data and functions to test some properties of Unicode code points.
Testing a rune
Functions starting with Is inspect which range table a rune belongs to.
The package includes IsLetter, IsLower, IsControl, and In.
A rune may fit into more than one range.
Is and In test a rune against a RangeTable.
Constants and tables
ReplacementChar represents invalid code points.
MaxASCII is the maximum ASCII value.
MaxLatin1 is the maximum Latin-1 value.
RangeTable defines a set of Unicode code points by listing ranges of code points.
The two slices must be in sorted order and non-overlapping.
See also
Claims
- id: C1 claim: Package unicode provides data and functions to test some properties of Unicode code points. source: S1 evidence: "Package unicode provides data and functions to test some properties of Unicode code points."
- id: C2 claim: Functions starting with Is can be used to inspect which table of range a rune belongs to. source: S1 evidence: "Functions starting with \"Is\" can be used to inspect"
- id: C3 claim: Note that runes may fit into more than one range. source: S1 evidence: "Note that runes may fit into more than one range."
- id: C4 claim: ReplacementChar represents invalid code points. source: S2 evidence: "Represents invalid code points."
Sources
- [S1] unicode package reference. The Go Authors. https://pkg.go.dev/unicode . License: BSD-3-Clause. Accessed 2026-11-24.
- [S2] letter.go source. The Go Authors. https://go.dev/src/unicode/letter.go . License: BSD-3-Clause. Accessed 2026-11-24.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, unicode package reference; The Go Authors, letter.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: The Go Authors, unicode package reference; The Go Authors, letter.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.
Cite this
iinventedlight. 2026. "Go unicode: test properties of Unicode code points." iinventedlight Library, iil:note:ktqd6tmg, version of 2026-11-24. https://iinventedlight.com/library/notes/go-unicode/. License: CC-BY-4.0.
@misc{iil_note_ktqd6tmg,
author = {{iinventedlight}},
title = {{Go unicode: test properties of Unicode code points}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-24},
url = {https://iinventedlight.com/library/notes/go-unicode/},
note = {Permanent ID iil:note:ktqd6tmg. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- go-unicode.schema.json (schema; CC-BY-4.0)
- go-unicode.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-unicode.md.