Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleScanner_earlyStop (0.09 sec)

  1. src/bufio/example_test.go

    	}
    	// Output: "1" "2" "3" "4" ""
    }
    
    // Use a Scanner with a custom split function to parse a comma-separated
    // 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
    			}
    Registered: Tue Sep 09 11:13:09 UTC 2025
    - Last Modified: Fri Nov 01 21:52:12 UTC 2024
    - 5.5K bytes
    - Viewed (0)
Back to top