summaryrefslogtreecommitdiff
path: root/vendor/github.com/goccy/go-json/internal/errors/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/goccy/go-json/internal/errors/error.go')
-rw-r--r--vendor/github.com/goccy/go-json/internal/errors/error.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/github.com/goccy/go-json/internal/errors/error.go b/vendor/github.com/goccy/go-json/internal/errors/error.go
index d58e39f4e..9207d0ff2 100644
--- a/vendor/github.com/goccy/go-json/internal/errors/error.go
+++ b/vendor/github.com/goccy/go-json/internal/errors/error.go
@@ -162,3 +162,22 @@ func ErrInvalidBeginningOfValue(c byte, cursor int64) *SyntaxError {
Offset: cursor,
}
}
+
+type PathError struct {
+ msg string
+}
+
+func (e *PathError) Error() string {
+ return fmt.Sprintf("json: invalid path format: %s", e.msg)
+}
+
+func ErrInvalidPath(msg string, args ...interface{}) *PathError {
+ if len(args) != 0 {
+ return &PathError{msg: fmt.Sprintf(msg, args...)}
+ }
+ return &PathError{msg: msg}
+}
+
+func ErrEmptyPath() *PathError {
+ return &PathError{msg: "path is empty"}
+}