Scan은 os.Stdin, 받은 입력을 interface{}에 저장하고
Sscan은 이미 저장해둔 string을 interface{}에 저장한다.
실행할 때 input이
Sscan은 이미 정해져있고
Scan은 아직 정해져있지 않은 것으로 생각하면 될듯하다.
// Scan scans text read from standard input, storing successive
// space-separated values into successive arguments. Newlines count
// as space. It returns the number of items successfully scanned.
// If that is less than the number of arguments, err will report why.
func Scan(a ...interface{}) (n int, err error) {
return Fscan(os.Stdin, a...)
}
// Sscan scans the argument string, storing successive space-separated
// values into successive arguments. Newlines count as space. It
// returns the number of items successfully scanned. If that is less
// than the number of arguments, err will report why.
func Sscan(str string, a ...interface{}) (n int, err error) {
return Fscan((*stringReader)(&str), a...)
}