Standard library / io/fs

fs.ErrClosed

Generic file-already-closed sentinel. Implementations may wrap it. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var ErrClosed error

Working Example

Example Snippetgo
package main
import (  "errors"  "fmt"  "io/fs")
func main() {  e := &fs.PathError{Op: "read", Path: "x", Err: fs.ErrClosed}  fmt.Println(errors.Is(e, fs.ErrClosed))}
Go Reference