gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

utility.go (284B)


      1 package rifs
      2 
      3 import (
      4 	"io"
      5 	"os"
      6 
      7 	"github.com/dsoprea/go-logging"
      8 )
      9 
     10 // GetOffset returns the current offset of the Seeker and just panics if unable
     11 // to find it.
     12 func GetOffset(s io.Seeker) int64 {
     13 	offsetRaw, err := s.Seek(0, os.SEEK_CUR)
     14 	log.PanicIf(err)
     15 
     16 	return offsetRaw
     17 }