File: discard_go14.go

package info (click to toggle)
golang-github-spkg-bom 0.0~git20160624.59b7046-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 76 kB
  • sloc: makefile: 2
file content (12 lines) | stat: -rw-r--r-- 210 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
// +build !go1.5

package bom

import "bufio"

func discardBytes(buf *bufio.Reader, n int) {
	// cannot use the buf.Discard method as it was introduced in Go 1.5
	for i := 0; i < n; i++ {
		buf.ReadByte()
	}
}