Scanln
Scanln is a function in the Go programming language’s standard library, within the fmt package. It reads input from standard input and assigns the scanned values to the provided variables. The function signature is func Scanln(a ...*T) (n int, err error), where a is a list of pointers to the destinations for the scanned values. It treats whitespace as a separator and reads input up to and including a newline, stopping after the newline has been read. The number of successfully scanned items is returned as n, along with any error encountered as err.
In practice, Scanln is used to obtain simple, line-oriented input from the user. Values are scanned in
If the input line contains tokens that do not match the expected types, an error is returned
Scanln is one of several related functions in the fmt package for input: it shares behavior patterns