Documentation ¶
Index ¶
- func ContainsNonBMPCodePoint(text string) bool
- func ContainsNonBMPCodePointUTF16(text []uint16) bool
- func DecodeWTF8Rune(s string) (rune, int)
- func EscapeClosingTag(text string, slashTag string) string
- func HashCombine(seed uint32, hash uint32) uint32
- func HashCombineString(seed uint32, text string) uint32
- func IsInsideNodeModules(path string) bool
- func MimeTypeByExtension(ext string) string
- func PrettyPrintedStack() string
- func QuoteForJSON(text string, asciiOnly bool) []byte
- func RemoveMultiLineCommentIndent(prefix string, text string) string
- func StringArrayToQuotedCommaSeparatedString(a []string) string
- func StringArraysEqual(a []string, b []string) bool
- func StringToUTF16(text string) []uint16
- func UTF16EqualsString(text []uint16, str string) bool
- func UTF16EqualsUTF16(a []uint16, b []uint16) bool
- func UTF16ToString(text []uint16) string
- func UTF16ToStringWithValidation(text []uint16) (string, uint16, bool)
- type BitSet
- type Joiner
- type Serializer
- type Timer
- type TypoDetector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsNonBMPCodePoint ¶ added in v0.14.19
func ContainsNonBMPCodePointUTF16 ¶ added in v0.14.19
This does "ContainsNonBMPCodePoint(UTF16ToString(text))" without any allocations
func DecodeWTF8Rune ¶ added in v0.14.19
This is a clone of "utf8.DecodeRuneInString" that has been modified to decode using WTF-8 instead. See https://simonsapin.github.io/wtf-8/ for more info.
func EscapeClosingTag ¶ added in v0.13.10
func HashCombine ¶ added in v0.11.19
From: http://boost.sourceforge.net/doc/html/boost/hash_combine.html
func HashCombineString ¶ added in v0.11.19
func IsInsideNodeModules ¶ added in v0.11.20
func MimeTypeByExtension ¶ added in v0.10.0
This is used instead of Go's built-in "mime.TypeByExtension" function because that function is broken on Windows: https://github.com/golang/go/issues/32350.
func PrettyPrintedStack ¶ added in v0.14.1
func PrettyPrintedStack() string
func QuoteForJSON ¶ added in v0.14.50
func RemoveMultiLineCommentIndent ¶ added in v0.13.10
func StringArrayToQuotedCommaSeparatedString ¶ added in v0.14.36
func StringArraysEqual ¶ added in v0.14.35
func StringToUTF16 ¶ added in v0.14.19
func UTF16EqualsString ¶ added in v0.14.19
Does "UTF16ToString(text) == str" without a temporary allocation
func UTF16EqualsUTF16 ¶ added in v0.14.19
func UTF16ToString ¶ added in v0.14.19
Types ¶
type Joiner ¶ added in v0.9.4
type Joiner struct {
// contains filtered or unexported fields
}
This provides an efficient way to join lots of big string and byte slices together. It avoids the cost of repeatedly reallocating as the buffer grows by measuring exactly how big the buffer should be and then allocating once. This is a measurable speedup.
func (*Joiner) EnsureNewlineAtEnd ¶ added in v0.9.4
func (j *Joiner) EnsureNewlineAtEnd()
type Serializer ¶ added in v0.14.18
type Serializer struct {
// contains filtered or unexported fields
}
Each call to "Enter(i)" doesn't start until "Leave(i-1)" is called
func MakeSerializer ¶ added in v0.14.18
func MakeSerializer(count int) Serializer
func (*Serializer) Enter ¶ added in v0.14.18
func (s *Serializer) Enter(i int)
func (*Serializer) Leave ¶ added in v0.14.18
func (s *Serializer) Leave(i int)
type TypoDetector ¶ added in v0.14.12
type TypoDetector struct {
// contains filtered or unexported fields
}
func MakeTypoDetector ¶ added in v0.14.12
func MakeTypoDetector(valid []string) TypoDetector
func (TypoDetector) MaybeCorrectTypo ¶ added in v0.14.12
func (detector TypoDetector) MaybeCorrectTypo(typo string) (string, bool)