errors

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsError

func AsError(errorText string) func(loc *SrcLocation)

AsError allows you to set a SrcLocation's error text

Pass this option in when you give the error Template a src location

func AsHelp

func AsHelp(helpText string) func(loc *SrcLocation)

AsHelp allows you to set a SrcLocation's text and mark it as a a helpful hint

Pass this option in when you give the error Template a src location

func AsWarning

func AsWarning(warningText string) func(loc *SrcLocation)

AsWarning allows you to set a SrcLocation's text and mark it as a warning

Pass this option in when you give the error Template a src location

Types

type LocationKind

type LocationKind uint8

LocationKind tells us what language and position markers we're using to identify the source

const (
	LocFile LocationKind = iota
	LocGoNode
	LocGoPos
	LocGoPositions
)

type LocationOption

type LocationOption func(*SrcLocation)

type LocationType

type LocationType uint8

LocationType represents if the locaton is the source of the error, a warning or a helpful hint

const (
	LocError LocationType = iota
	LocWarning
	LocHelp
)

type RangeOption

type RangeOption func(*rangeConfig)

func WithRangeSize

func WithRangeSize(size int) RangeOption

WithRangeSize sets the size of the range. The default is 100.