Standard library / time
time.ParseError
Structured timestamp parse failure. Layout and Value retain original input; LayoutElem, ValueElem and Message describe the failure. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
type ParseError struct { Layout, Value, LayoutElem, ValueElem, Message string }Working Example
Example Snippetgo
package main
import ( "fmt" "time")
func main() { _, err := time.Parse(time.DateOnly, "oops") e, ok := err.(*time.ParseError) fmt.Println(ok && e.Value == "oops")}