scanners

package
v0.0.0-...-2ec3d85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flush

func Flush()

scan for residual text in line, equivalent to flushing the buffer

func FlushValue

func FlushValue() string

returns flushed text. Call it after calling any of the following: Flush(), Scanf(), ScanString(), ScanInt(), ScanFloat(), or any function in this package that claims to clear the buffer

func ScanFloat

func ScanFloat() (f float64)

scan for a float64 from std input (console)

func ScanInt

func ScanInt() (i int)

scan for a int from std input (console)

func ScanLine

func ScanLine() (string, error)

scans the whole line and returns it as string if error, returns first non EOF error

func ScanString

func ScanString() (str string)

scan for a string from std input (console) it will by default trim all the empty spaces at the beginning and end of the input text

func Scanf

func Scanf(format string, a ...interface{}) (n int, err error)

Scanf scans text read from standard input, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully scanned. If that is less than the number of arguments, err will report why. Newlines in the input must match newlines in the format. The one exception: the verb %c always scans the next rune in the input, even if it is a space (or tab etc.) or newline. This function additionally flushes the buffer so you do not have to deal with stray input

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL