```
package main
import "fmt"
func main() {
var name string
fmt.Scanln(&name)
fmt.Println(name)
}
```
运行,输入了a b c为什么只获取到了a,有啥好的办法,都是可以获取呢
```
$ go run c2.go
a b c
a
```
更多评论
```go
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
r := bufio.NewReader(os.Stdin)
for {
l, err := r.ReadString('\n')
if err != nil {
return
}
fmt.Println(l)
}
}
```
#3