Why does io.WriterTo's WriteTo method return an int64 rather than an int?
问题 Most of the output methods in Go's io package return (int, error) , for example io.Writer 's Write([]byte) method and the io.WriteString(io.Writer, string) function. However, a few of the output methods, such as io.WriterTo 's WriteTo method, return (int64, error) instead. This makes it inconvenient to implement WriteTo in terms of Write or WriteString without storing an intermediate value and type converting it from int to int64 . What is the reason for this discrepancy? 回答1: It's possible