Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleScanner_earlyStop (0.23 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
    			}
    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)
Back to top