- Sort Score
- Num 10 results
- Language All
Results 1 - 3 of 3 for AppendRune (0.14 seconds)
-
src/bytes/bytes.go
// fine. It could also shrink but that falls out naturally. b := make([]byte, 0, len(s)) for i := 0; i < len(s); { r, wid := utf8.DecodeRune(s[i:]) r = mapping(r) if r >= 0 { b = utf8.AppendRune(b, r) } i += wid } return b } // Despite being an exported symbol, // Repeat is linknamed by widely used packages. // Notable members of the hall of shame include:
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Thu Mar 12 17:56:55 GMT 2026 - 36.3K bytes - Click Count (0) -
src/bytes/bytes_test.go
m := utf8.RuneLen(needle) for o := m; o > 0; { _, sz := utf8.DecodeLastRune(buf) copy(buf[len(buf)-sz:], "\x00\x00\x00\x00") buf = buf[:len(buf)-sz] o -= sz } buf = utf8.AppendRune(buf[:n-m], needle) n -= m // adjust for rune len for i := 0; i < b.N; i++ { j := IndexRune(buf, needle) if j != n { b.Fatal("bad index", j) } } for i := range buf {
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Wed Mar 11 03:07:05 GMT 2026 - 62.9K bytes - Click Count (0) -
doc/go_spec.html
The <a href="/pkg/cmd/vet"><code>go vet</code></a> tool flags certain integer-to-string conversions as potential errors. Library functions such as <a href="/pkg/unicode/utf8#AppendRune"><code>utf8.AppendRune</code></a> or <a href="/pkg/unicode/utf8#EncodeRune"><code>utf8.EncodeRune</code></a> should be used instead. </li> </ol>
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Wed Apr 01 23:39:18 GMT 2026 - 287.8K bytes - Click Count (1)