Help us shape the future of Go! Take the 2026 Go Developer Survey

errors

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataTooShort added in v0.0.5

func DataTooShort() error

func ErrExpecting added in v0.0.7

func ErrExpecting(msg string, buf []byte, cursor int) error

func ErrValueOverflow

func ErrValueOverflow(v any, t string) error

Types

type InvalidUnmarshalError

type InvalidUnmarshalError struct {
	Type reflect.Type
}

func (*InvalidUnmarshalError) Error

func (e *InvalidUnmarshalError) Error() string

type SyntaxError

type SyntaxError struct {
	Offset int // error occurred after reading Offset bytes
	// contains filtered or unexported fields
}

A SyntaxError is a description of a JSON syntax error.

func ErrExceededMaxDepth

func ErrExceededMaxDepth(c byte, cursor int) *SyntaxError

func ErrInvalidBeginningOfValue

func ErrInvalidBeginningOfValue(c byte, cursor int) *SyntaxError

func ErrInvalidCharacter

func ErrInvalidCharacter(c byte, context string, cursor int) *SyntaxError

func ErrSyntax

func ErrSyntax(msg string, offset int) *SyntaxError

func ErrUnexpectedEnd

func ErrUnexpectedEnd(msg string, cursor int) *SyntaxError

func (*SyntaxError) Error

func (e *SyntaxError) Error() string

type UnmarshalTypeError

type UnmarshalTypeError struct {
	Value  string       // description of JSON value - "bool", "array", "number -5"
	Type   reflect.Type // type of Go value it could not be assigned to
	Offset int          // error occurred after reading Offset bytes
	Struct string       // name of the struct type containing the field
	Field  string       // the full path from root node to the field
}

An UnmarshalTypeError describes a JSON value that was not appropriate for a value of a specific Go type.

func (*UnmarshalTypeError) Error

func (e *UnmarshalTypeError) Error() string

type UnsupportedTypeError

type UnsupportedTypeError struct {
	Type reflect.Type
}

An UnsupportedTypeError is returned by Marshal when attempting to encode an unsupported value type.

func (*UnsupportedTypeError) Error

func (e *UnsupportedTypeError) Error() string

type UnsupportedValueError

type UnsupportedValueError struct {
	Value reflect.Value
	Str   string
}

func (*UnsupportedValueError) Error

func (e *UnsupportedValueError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL