Files
config/definition/option/errors.go
andrey f9a0411192
All checks were successful
Go Action / goaction (push) Successful in 29s
def (#12)
Reviewed-on: #12
2025-12-26 14:55:42 +03:00

31 lines
376 B
Go

package option
import (
"errors"
"fmt"
)
type Error struct {
Key []string
Err error
}
func (o Error) Error() string {
return fmt.Sprintf("%s: %s", o.Key, o.Err)
}
func (o Error) Is(err error) bool {
return errors.Is(err, o.Err)
}
func (o Error) Unwrap() error {
return o.Err
}
func Err(err error, key []string) Error {
return Error{
Key: key,
Err: err,
}
}