- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for LastIndexByte (0.1 sec)
-
src/bytes/example_test.go
// Output: // 5 // 3 // -1 } func ExampleLastIndexByte() { fmt.Println(bytes.LastIndexByte([]byte("go gopher"), byte('g'))) fmt.Println(bytes.LastIndexByte([]byte("go gopher"), byte('r'))) fmt.Println(bytes.LastIndexByte([]byte("go gopher"), byte('z'))) // Output: // 3 // 8 // -1 } func ExampleLastIndexFunc() {
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Mon May 12 16:07:54 UTC 2025 - 16.5K bytes - Viewed (0) -
docs/debugging/inspect/main.go
if *genkey { generateKeys() os.Exit(0) } var privateKeys [][]byte if *keyHex == "" { // Attempt to load private key(s) n := 1 var base, ext string base = *privKeyPath if idx := strings.LastIndexByte(base, '.'); idx != -1 { ext = base[idx:] base = base[:idx] } for { // Automatically read "file.ext", "file-2.ext", "file-3.ext"... fn := base + ext if n > 1 {
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Mon Feb 17 17:09:42 UTC 2025 - 5.7K bytes - Viewed (0) -
cmd/api-headers.go
lc.SetPredictionHeaders(w, objInfo.ToLifecycleOpts()) } if v, ok := objInfo.UserDefined[ReservedMetadataPrefix+"compression"]; ok { if i := strings.LastIndexByte(v, '/'); i >= 0 { v = v[i+1:] } w.Header()[xhttp.MinIOCompressed] = []string{v} } return nil } // needsEncoding reports whether s contains any bytes that need to be encoded.
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 8.6K bytes - Viewed (0) -
src/bytes/bytes.go
return len(s) case n == 1: return bytealg.LastIndexByte(s, sep[0]) case n == len(s): if Equal(s, sep) { return 0 } return -1 case n > len(s): return -1 } return bytealg.LastIndexRabinKarp(s, sep) } // LastIndexByte returns the index of the last instance of c in s, or -1 if c is not present in s. func LastIndexByte(s []byte, c byte) int { return bytealg.LastIndexByte(s, c) }
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Wed Sep 03 14:04:47 UTC 2025 - 35.5K bytes - Viewed (0) -
api/go1.5.txt
pkg archive/zip, method (*Writer) SetOffset(int64) pkg bufio, method (*Reader) Discard(int) (int, error) pkg bufio, method (ReadWriter) Discard(int) (int, error) pkg bytes, func LastIndexByte([]uint8, uint8) int pkg bytes, method (*Buffer) Cap() int pkg bytes, method (*Reader) Size() int64 pkg crypto, const SHA512_224 = 14 pkg crypto, const SHA512_224 Hash pkg crypto, const SHA512_256 = 15 pkg crypto, const SHA512_256 Hash
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Thu Jul 30 21:14:09 UTC 2015 - 46.6K bytes - Viewed (0) -
cmd/data-usage-cache.go
// This is an O(N*N) operation if there is no parent or it cannot be guessed. func (d *dataUsageCache) searchParent(h dataUsageHash) *dataUsageHash { want := h.Key() if idx := strings.LastIndexByte(want, '/'); idx >= 0 { if v := d.find(want[:idx]); v != nil { _, ok := v.Children[want] if ok { found := hashPath(want[:idx]) return &found } } } for k, v := range d.Cache {
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 34.7K bytes - Viewed (0) -
src/archive/zip/reader.go
if err != nil { return nil, err } return rc.(fs.File), nil } func split(name string) (dir, elem string, isDir bool) { name, isDir = strings.CutSuffix(name, "/") i := strings.LastIndexByte(name, '/') if i < 0 { return ".", name, isDir } return name[:i], name[i+1:], isDir } var dotFile = &fileListEntry{name: "./", isDir: true}
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Tue Mar 11 22:19:38 UTC 2025 - 28.4K bytes - Viewed (0) -
src/bytes/bytes_test.go
{"zabcdefabcdef", "z", 0}, // first byte {"a☺b☻c☹d", "b", len("a☺")}, // non-ascii } for _, test := range testCases { actual := LastIndexByte([]byte(test.a), test.b[0]) if actual != test.i { t.Errorf("LastIndexByte(%q,%c) = %v; want %v", test.a, test.b[0], actual, test.i) } } } // test a larger buffer with different sizes and alignments func TestIndexByteBig(t *testing.T) {
Registered: Tue Sep 09 11:13:09 UTC 2025 - Last Modified: Mon Jul 28 18:13:58 UTC 2025 - 62.9K bytes - Viewed (0) -
docs/debugging/xl-meta/main.go
return '_' } }, file) } if baseName == "" { if strings.HasSuffix(file, "/xl.meta") { baseName = strings.TrimSuffix(file, "/xl.meta") if idx := strings.LastIndexByte(baseName, '/'); idx > 0 { baseName = baseName[idx+1:] } } } err := data.files(func(name string, data []byte) { fn := fmt.Sprintf("%s-%s.data", file, name)
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 40.3K bytes - Viewed (0)