Standard library / bufio

bufio.Scanner.Scan()

Advances to the next token, returning false at EOF or error. Consult Err when it stops. Expected stdout: 'true x false <nil>\n'.

Formal Syntax & Structure

go syntaxgo
func (s *Scanner) Scan() bool

Return Value

bool

Advances to the next token, returning false at EOF or error.

Working Example

Example Snippetgo
package main
import (  "bufio"  "fmt"  "strings")
func main() {  s := bufio.NewScanner(strings.NewReader("x"))  fmt.Println(s.Scan(), s.Text(), s.Scan(), s.Err())}
Go Reference