...

Source file src/github.com/dsoprea/go-utility/v2/filesystem/utility.go

Documentation: github.com/dsoprea/go-utility/v2/filesystem

     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  }
    18  

View as plain text