Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for freeScanner (0.2 sec)

  1. src/encoding/json/indent.go

    	b, err := appendCompact(b, src, false)
    	dst.Write(b)
    	return err
    }
    
    func appendCompact(dst, src []byte, escape bool) ([]byte, error) {
    	origLen := len(dst)
    	scan := newScanner()
    	defer freeScanner(scan)
    	start := 0
    	for i, c := range src {
    		if escape && (c == '<' || c == '>' || c == '&') {
    			if start < i {
    				dst = append(dst, src[start:i]...)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 06 20:19:31 UTC 2023
    - 5.4K bytes
    - Viewed (0)
  2. src/encoding/json/scanner.go

    // before diving into the scanner itself.
    
    import (
    	"strconv"
    	"sync"
    )
    
    // Valid reports whether data is a valid JSON encoding.
    func Valid(data []byte) bool {
    	scan := newScanner()
    	defer freeScanner(scan)
    	return checkValid(data, scan) == nil
    }
    
    // checkValid verifies that data is valid JSON-encoded data.
    // scan is passed in for use by checkValid to avoid an allocation.
    // checkValid returns nil or a SyntaxError.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 16.1K bytes
    - Viewed (0)
Back to top