Why doesn't everything be read out after using peek in bufio? What should be understood by peek?

package main

import (
    "os"
    "bufio"
    "fmt"
    "io/ioutil"
)

func main()  {
    f,err := os.Open("b.txt")
    if err != nil {
        panic(err)
    }
    
     _,err= bufio.NewReader(f).Peek(64)
    if err != nil {
        panic(err)
    }
    r,err:=ioutil.ReadAll(f)
    if err != nil {
        panic(err)
    }
     fmt.Println(string(r))
}

it is written on the document that peek will not move the read position, so why is it that my code above does not read everything? But the rest of the content
peek how to understand?

here is the explanation of the peek function on the official website

clipboard.png


package main

import (
    "os"
    "bufio"
    "fmt"
    "io/ioutil"
)

func main()  {
    f,err := os.Open("b.txt")
    if err != nil {
        panic(err)
    }

    nReader := bufio.NewReader(f)
    _,err = nReader.Peek(64)
     //_,err= bufio.NewReader(f).Peek(64)
    if err != nil {
        panic(err)
    }
     r,err:=ioutil.ReadAll(nReader)
    if err != nil {
        panic(err)
    }
     fmt.Println(string(r))
}
The

problem is solved. Peek is for Reader, so it's the Reader object that should be manipulated, not f

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a7cd-2b57e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a7cd-2b57e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?