Recently, I am reading "The Go Progrmming Language" Book. In the chapter 7.5, I am confused about below code. Why f(buf) will panic but f(w)?
package main
import (
    "bytes"
    "fmt"
    "io"
    "os"
)
func main() {
    var w io.Writer
    fmt.Printf("%T\n", w)
    f(w)
    w = os.Stdout
    fmt.Printf("%T\n", w)
    w = new(bytes.Buffer)
    fmt.Printf("%T\n", w)
    var buf *bytes.Buffer
    fmt.Printf("%T\n", buf)
    f(buf)
}
func f(out io.Writer)  {
    fmt.Printf("%T\n", out)
    if out != nil {
        out.Write([]byte("done!\n"))
    }
}
 
    