- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for IndexByte (0.08 sec)
-
src/bytes/bytes_js_wasm_test.go
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Wed Jul 17 07:00:20 UTC 2024 - 417 bytes - Viewed (0) -
src/bytes/boundary_test.go
Equal(b[len(b)-i:], b[:i]) } } func TestIndexByteNearPageBoundary(t *testing.T) { t.Parallel() b := dangerousSlice(t) for i := range b { idx := IndexByte(b[i:], 1) if idx != -1 { t.Fatalf("IndexByte(b[%d:])=%d, want -1\n", i, idx) } } } func TestIndexNearPageBoundary(t *testing.T) { t.Parallel() q := dangerousSlice(t) if len(q) > 64 {
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Thu Nov 30 20:05:58 UTC 2023 - 2.8K bytes - Viewed (0) -
istioctl/pkg/multixds/google.go
} const projSeg = "/projects/" i := strings.Index(u.Path, projSeg) if i == -1 { return nil, fmt.Errorf("webhook URL %s doesn't contain the projects segment", u) } i += len(projSeg) j := strings.IndexByte(u.Path[i:], '/') if j == -1 { return nil, fmt.Errorf("webhook URL %s is malformed", u) } ret.gcpProject = u.Path[i : i+j] const crSeg = "/ISTIO_META_CLOUDRUN_ADDR/" i += j
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Mon Jun 06 03:39:27 UTC 2022 - 1.5K bytes - Viewed (0) -
cmd/os-dirent_namelen_linux.go
limit := dirent.Reclen - fixedHdr if limit > nameBufLen { limit = nameBufLen } // Avoid bugs in long file names // https://github.com/golang/tools/commit/5f9a5413737ba4b4f692214aebee582b47c8be74 nameLen := bytes.IndexByte(nameBuf[:limit], 0) if nameLen < 0 { return 0, fmt.Errorf("failed to find terminating 0 byte in dirent") } return uint64(nameLen), nil
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Aug 19 01:35:22 UTC 2021 - 1.5K bytes - Viewed (0) -
cmd/streaming-v4-unsigned.go
input := bufio.NewScanner(bytes.NewReader(valueBuffer.Bytes())) for input.Scan() { line := strings.TrimSpace(input.Text()) if line == "" { continue } // Find first separator. idx := strings.IndexByte(line, trailerKVSeparator[0]) if idx <= 0 || idx >= len(line) { if cr.debug { fmt.Printf("Could not find separator, got %q\n", line) } return errMalformedEncoding }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat May 06 02:53:12 UTC 2023 - 6.1K bytes - Viewed (0) -
src/bytes/iter.go
// It returns a single-use iterator. func Lines(s []byte) iter.Seq[[]byte] { return func(yield func([]byte) bool) { for len(s) > 0 { var line []byte if i := IndexByte(s, '\n'); i >= 0 { line, s = s[:i+1], s[i+1:] } else { line, s = s, nil } if !yield(line[:len(line):len(line)]) { return } } return } }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Wed Aug 14 18:23:13 UTC 2024 - 3.7K bytes - Viewed (0) -
src/bufio/example_test.go
// list with an empty final value but stops at the token "STOP". func ExampleScanner_earlyStop() { onComma := func(data []byte, atEOF bool) (advance int, token []byte, err error) { i := bytes.IndexByte(data, ',') if i == -1 { if !atEOF { return 0, nil, nil } // If we have reached the end, return the last token. return 0, data, bufio.ErrFinalToken }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Fri Nov 01 21:52:12 UTC 2024 - 5.5K bytes - Viewed (0) -
src/archive/tar/strconv.go
} // parseString parses bytes as a NUL-terminated C-style string. // If a NUL byte is not found then the whole slice is returned as a string. func (*parser) parseString(b []byte) string { if i := bytes.IndexByte(b, 0); i >= 0 { return string(b[:i]) } return string(b) } // formatString copies s into b, NUL-terminating if possible. func (f *formatter) formatString(b []byte, s string) { if len(s) > len(b) {
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Aug 01 14:28:42 UTC 2023 - 9K bytes - Viewed (0)