Standard library / io

io.ReadWriteSeeker

Combines read, write and seek; often implemented by files. Use the interface when all three operations are needed. Expected stdout: 'contract satisfied\n'.

Formal Syntax & Structure

go syntaxgo
type ReadWriteSeeker interface {  Reader  Writer  Seeker}

Working Example

Example Snippetgo
package main
import (  "fmt"  "io"  "strings")
func main() {  var _ io.ReadWriteSeeker = struct {    io.Reader    io.Writer    io.Seeker  }{strings.NewReader("a"), io.Discard, strings.NewReader("a")}  fmt.Println("contract satisfied")}
Go Reference