This file is indexed.

/usr/share/gocode/src/github.com/kr/binarydist/seek.go is in golang-github-kr-binarydist-dev 0.0~git20120828.0.9955b0a-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package binarydist

import (
	"errors"
)

type seekBuffer struct {
	buf []byte
	pos int
}

func (b *seekBuffer) Write(p []byte) (n int, err error) {
	n = copy(b.buf[b.pos:], p)
	if n == len(p) {
		b.pos += n
		return n, nil
	}
	b.buf = append(b.buf, p[n:]...)
	b.pos += len(p)
	return len(p), nil
}

func (b *seekBuffer) Seek(offset int64, whence int) (ret int64, err error) {
	var abs int64
	switch whence {
	case 0:
		abs = offset
	case 1:
		abs = int64(b.pos) + offset
	case 2:
		abs = int64(len(b.buf)) + offset
	default:
		return 0, errors.New("binarydist: invalid whence")
	}
	if abs < 0 {
		return 0, errors.New("binarydist: negative position")
	}
	if abs >= 1<<31 {
		return 0, errors.New("binarydist: position out of range")
	}
	b.pos = int(abs)
	return abs, nil
}