// Open a file for reading file, err := os.Open("myfile.txt") if err != nil { panic(err) } defer file.Close() // Create a new buffered reader reader := bufio.NewReader(file) // Read one byte at a time for { b, err := reader.ReadByte() if err == io.EOF { break } // Do something with the byte... fmt.Printf("%c", b) // "Unread" the byte err = reader.UnreadByte() if err != nil { panic(err) } }This code snippet reads from a file using a buffered reader, then reads one byte at a time from the input stream, printing each byte to the console. After each byte is read, it is "un-read" using the UnreadByte method. In determining the package library, the use of the bufio package indicates that it is likely part of the standard library in Go.