Golang bufio.Scan() function example
package bufio
Scan advances the Scanner to the next token, which will then be available through the Bytes or Text method.
Golang bufio.Scan() function usage example
reader := bufio.NewReader(file)
scanner := bufio.NewScanner(reader)
scanner.Split(bufio.ScanBytes)
for scanner.Scan() { // continue Scan for next byte
fmt.Println(scanner.Bytes())
}
Reference :
Advertisement
Something interesting
Tutorials
+5.4k Golang : Reclaim memory occupied by make() example
+11.9k Golang : Convert decimal number(integer) to IPv4 address
+9.4k Golang : Launch Mac OS X Preview (or other OS) application from your program example
+80.6k Golang : How to return HTTP status code?
+10.1k Golang : Get login name from environment and prompt for password
+8.2k Golang : Get final or effective URL with Request.URL example
+12.9k Python : Convert IPv6 address to decimal and back to IPv6
+13.5k Golang : Count number of runes in string
+27.4k Golang : Convert CSV data to JSON format and save to file
+10.5k Swift : Convert (cast) String to Integer
+32.2k Golang : Convert []string to []byte examples
+13.6k Golang : Get user input until a command or receive a word to stop