discard_go14.go 210 B

123456789101112
  1. // +build !go1.5
  2. package bom
  3. import "bufio"
  4. func discardBytes(buf *bufio.Reader, n int) {
  5. // cannot use the buf.Discard method as it was introduced in Go 1.5
  6. for i := 0; i < n; i++ {
  7. buf.ReadByte()
  8. }
  9. }