```go
reader := bufio.NewReader(strReader)
r, _ = reader.ReadString('\n')
//r, _ = reader.ReadString([]byte("\n")[0])
```
第一个报错:cannot use reader.ReadString('\n') (value of type string) as type rune in assignment
第二个报错:cannot use reader.ReadString([]byte("\n")[0]) (value of type string) as type rune in assignment
go版本1.19.3,上面这两种方法不都是没错的吗?
有疑问加站长微信联系(非本文作者)