summaryrefslogtreecommitdiff
path: root/vendor/github.com/goccy/go-json/internal/errors/error.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2023-02-25 13:12:40 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-25 12:12:40 +0000
commitecdc8379fa8f9d88faca626e7de748c2afbe4910 (patch)
tree8c20a5826db2136fc89bee45e15355c5899fa65b /vendor/github.com/goccy/go-json/internal/errors/error.go
parent[bugfix] Fix deleted status causing issues when getting bookmark (#1551) (diff)
downloadgotosocial-ecdc8379fa8f9d88faca626e7de748c2afbe4910.tar.xz
[chore] Update gin to v1.9.0 (#1553)
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"}
+}