Standard library / io/fs

fs.ErrPermission

Generic filesystem permission-denied sentinel, often wrapped in PathError. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var ErrPermission error

Working Example

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