Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for validate (0.52 sec)

  1. src/bufio/example_test.go

    	if err := scanner.Err(); err != nil {
    		fmt.Fprintln(os.Stderr, "reading input:", err)
    	}
    	fmt.Printf("%d\n", count)
    	// Output: 15
    }
    
    // Use a Scanner with a custom split function (built by wrapping ScanWords) to validate
    // 32-bit decimal input.
    func ExampleScanner_custom() {
    	// An artificial input source.
    	const input = "1234 5678 1234567901234567890"
    	scanner := bufio.NewScanner(strings.NewReader(input))
    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)
  2. src/archive/zip/reader.go

    	end, baseOffset, err := readDirectoryEnd(rdr, size)
    	if err != nil {
    		return err
    	}
    	r.r = rdr
    	r.baseOffset = baseOffset
    	// Since the number of directory records is not validated, it is not
    	// safe to preallocate r.File without first checking that the specified
    	// number of files is reasonable, since a malformed archive may
    	// indicate it contains up to 1 << 128 - 1 files. Since each file has a
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 27.7K bytes
    - Viewed (0)
  3. src/cmd/cgo/internal/test/issue1435.go

    			line = strings.TrimSpace(line)
    			if strings.HasPrefix(line, "Pid:\t") {
    				// On loaded systems, it is possible
    				// for a TID to be reused really
    				// quickly. As such, we need to
    				// validate that the thread status
    				// info we just read is a task of the
    				// same process PID as we are
    				// currently running, and not a
    				// recently terminated thread
    				// resurfaced in a different process.
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Jul 28 21:31:41 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  4. src/bufio/scan.go

    	}
    	// Request more data.
    	return 0, nil, nil
    }
    
    // isSpace reports whether the character is a Unicode white space character.
    // We avoid dependency on the unicode package, but check validity of the implementation
    // in the tests.
    func isSpace(r rune) bool {
    	if r <= '\u00FF' {
    		// Obvious ASCII ones: \t through \r plus space. Plus two Latin-1 oddballs.
    		switch r {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 14.2K bytes
    - Viewed (0)
  5. src/archive/tar/writer.go

    	blk := tw.templateV7Plus(hdr, f.formatString, f.formatOctal)
    	f.formatString(blk.toUSTAR().prefix(), namePrefix)
    	blk.setFormat(FormatUSTAR)
    	if f.err != nil {
    		return f.err // Should never happen since header is validated
    	}
    	return tw.writeRawHeader(blk, hdr.Size, hdr.Typeflag)
    }
    
    func (tw *Writer) writePAXHeader(hdr *Header, paxHdrs map[string]string) error {
    	realName, realSize := hdr.Name, hdr.Size
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
  6. src/archive/tar/common.go

    )
    
    // validateSparseEntries reports whether sp is a valid sparse map.
    // It does not matter whether sp represents data fragments or hole fragments.
    func validateSparseEntries(sp []sparseEntry, size int64) bool {
    	// Validate all sparse entries. These are the same checks as performed by
    	// the BSD tar utility.
    	if size < 0 {
    		return false
    	}
    	var pre sparseEntry
    	for _, cur := range sp {
    		switch {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24.7K bytes
    - Viewed (2)
  7. src/bufio/scan_test.go

    func TestScanRune(t *testing.T) {
    	for n, test := range scanTests {
    		buf := strings.NewReader(test)
    		s := NewScanner(buf)
    		s.Split(ScanRunes)
    		var i, runeCount int
    		var expect rune
    		// Use a string range loop to validate the sequence of runes.
    		for i, expect = range test {
    			if !s.Scan() {
    				break
    			}
    			runeCount++
    			got, _ := utf8.DecodeRune(s.Bytes())
    			if got != expect {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Sep 22 16:22:42 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  8. src/cmd/cgo/gcc.go

    	for len(c.ptrKeys) > 0 {
    		dtype := c.ptrKeys[0]
    		dtypeKey := dtype.String()
    		c.ptrKeys = c.ptrKeys[1:]
    		ptrs := c.ptrs[dtypeKey]
    		delete(c.ptrs, dtypeKey)
    
    		// Note Type might invalidate c.ptrs[dtypeKey].
    		t := c.Type(dtype, pos)
    		for _, ptr := range ptrs {
    			ptr.Go.(*ast.StarExpr).X = t.Go
    			ptr.C.Set("%s*", t.C)
    		}
    	}
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Nov 02 16:43:23 GMT 2023
    - 97K bytes
    - Viewed (0)
  9. src/archive/tar/reader.go

    		key, value, residual, err := parsePAXRecord(sbuf)
    		if err != nil {
    			return nil, ErrHeader
    		}
    		sbuf = residual
    
    		switch key {
    		case paxGNUSparseOffset, paxGNUSparseNumBytes:
    			// Validate sparse header order and value.
    			if (len(sparseMap)%2 == 0 && key != paxGNUSparseOffset) ||
    				(len(sparseMap)%2 == 1 && key != paxGNUSparseNumBytes) ||
    				strings.Contains(value, ",") {
    				return nil, ErrHeader
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
Back to top