Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for indexType (0.2 sec)

  1. src/bytes/bytes.go

    func ContainsFunc(b []byte, f func(rune) bool) bool {
    	return IndexFunc(b, f) >= 0
    }
    
    // IndexByte returns the index of the first instance of c in b, or -1 if c is not present in b.
    func IndexByte(b []byte, c byte) int {
    	return bytealg.IndexByte(b, c)
    }
    
    func indexBytePortable(s []byte, c byte) int {
    	for i, b := range s {
    		if b == c {
    			return i
    		}
    	}
    	return -1
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  2. src/bytes/bytes_test.go

    			b1[j] = 'x'
    			pos := IndexByte(b1, 'x')
    			if pos != j {
    				t.Errorf("IndexByte(%q, 'x') = %v", b1, pos)
    			}
    			b1[j] = 0
    			pos = IndexByte(b1, 'x')
    			if pos != -1 {
    				t.Errorf("IndexByte(%q, 'x') = %v", b1, pos)
    			}
    		}
    		// different end alignments
    		b1 = b[:i]
    		for j := 0; j < len(b1); j++ {
    			b1[j] = 'x'
    			pos := IndexByte(b1, 'x')
    			if pos != j {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  3. 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 {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Nov 30 20:05:58 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  4. 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
    		}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat May 06 02:53:12 GMT 2023
    - 6.1K bytes
    - Viewed (1)
  5. internal/jwt/parser.go

    func ParseUnverifiedStandardClaims(token []byte, claims *StandardClaims, buf []byte) (*SigningMethodHMAC, error) {
    	if bytes.Count(token, []byte(".")) != 2 {
    		return nil, jwtgo.ErrSignatureInvalid
    	}
    
    	i := bytes.IndexByte(token, '.')
    	j := bytes.LastIndexByte(token, '.')
    
    	n, err := base64DecodeBytes(token[:i], buf)
    	if err != nil {
    		return nil, &jwtgo.ValidationError{Inner: err, Errors: jwtgo.ValidationErrorMalformed}
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue May 09 07:53:08 GMT 2023
    - 13.9K bytes
    - Viewed (0)
  6. 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
    		}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  7. src/bytes/example_test.go

    	fmt.Println(bytes.Index([]byte("chicken"), []byte("dmr")))
    	// Output:
    	// 4
    	// -1
    }
    
    func ExampleIndexByte() {
    	fmt.Println(bytes.IndexByte([]byte("chicken"), byte('k')))
    	fmt.Println(bytes.IndexByte([]byte("chicken"), byte('g')))
    	// Output:
    	// 4
    	// -1
    }
    
    func ExampleIndexFunc() {
    	f := func(c rune) bool {
    		return unicode.Is(unicode.Han, c)
    	}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  8. cmd/metacache-walk.go

    		forward := ""
    		if len(opts.ForwardTo) > 0 && strings.HasPrefix(opts.ForwardTo, current) {
    			forward = strings.TrimPrefix(opts.ForwardTo, current)
    			// Trim further directories and trailing slash.
    			if idx := strings.IndexByte(forward, '/'); idx > 0 {
    				forward = forward[:idx]
    			}
    		}
    		if contextCanceled(ctx) {
    			return ctx.Err()
    		}
    		if opts.Limit > 0 && objsReturned >= opts.Limit {
    			return nil
    		}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 12.4K bytes
    - Viewed (0)
  9. istioctl/pkg/validate/validate.go

    	case []any:
    		return transformInterfaceArray(v)
    	case map[any]any:
    		return transformInterfaceMap(v)
    	default:
    		return v
    	}
    }
    
    func servicePortPrefixed(n string) bool {
    	i := strings.IndexByte(n, '-')
    	if i >= 0 {
    		n = n[:i]
    	}
    	p := protocol.Parse(n)
    	return p == protocol.Unsupported
    }
    
    func handleNamespace(istioNamespace string) string {
    	if istioNamespace == "" {
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Mon Jan 22 17:58:52 GMT 2024
    - 15K bytes
    - Viewed (0)
  10. 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) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Aug 01 14:28:42 GMT 2023
    - 9K bytes
    - Viewed (0)
Back to top