summaryrefslogtreecommitdiff
path: root/vendor/github.com/dsoprea/go-utility/v2/filesystem/utility.go
blob: 4b33b41a975dde218d73bdcd7651dd185e1c2b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package rifs

import (
	"io"
	"os"

	"github.com/dsoprea/go-logging"
)

// GetOffset returns the current offset of the Seeker and just panics if unable
// to find it.
func GetOffset(s io.Seeker) int64 {
	offsetRaw, err := s.Seek(0, os.SEEK_CUR)
	log.PanicIf(err)

	return offsetRaw
}