Standard library / strconv

strconv.ErrSyntax

Sentinel error indicating invalid conversion syntax. Use errors.Is to match it inside a NumError. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var ErrSyntax error

Working Example

Example Snippetgo
package main
import (  "errors"  "fmt"  "strconv")
func main() {  _, e := strconv.Atoi("x")  fmt.Println(errors.Is(e, strconv.ErrSyntax))}
Go Reference