Standard library / net
net.OpError.Temporary()
Deprecated classification: use timeout or explicit errors instead. This constructed EOF error is not temporary. Expected stdout: 'false\n'.
Formal Syntax & Structure
go syntaxgo
func (e *OpError) Temporary() boolReturn Value
bool
Operation result; check errors and validity indicators when returned.
Working Example
Example Snippetgo
package main
import ( "fmt" "io" "net")
func main() { e := &net.OpError{Op: "read", Err: io.EOF}; fmt.Println(e.Temporary()) }
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}