Standard library / io

io.SectionReader.Outer()

Returns the original ReaderAt, base offset and section length supplied to NewSectionReader. Expected stdout: 'true 1 2\n'.

Formal Syntax & Structure

go syntaxgo
func (s *SectionReader) Outer() (r ReaderAt, off int64, n int64)

Return Value

(r ReaderAt, off int64, n int64)

Returns the original ReaderAt, base offset and section length supplied to NewSectionReader.

Working Example

Example Snippetgo
package main
import (  "fmt"  "io"  "strings")
func main() {  r := strings.NewReader("abcd")  s := io.NewSectionReader(r, 1, 2)  outer, off, n := s.Outer()  fmt.Println(outer == r, off, n)}
Go Reference