Standard library / io

io.EOF

Signals graceful end of input; Reader should return this sentinel directly. Consume any returned bytes before handling it. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var EOF error

Working Example

Example Snippetgo
package main
import (  "fmt"  "io"  "strings")
func main() { _, e := strings.NewReader("").Read(make([]byte, 1)); fmt.Println(e == io.EOF) }
Go Reference