diff options
author | Wim <wim@42.be> | 2021-10-17 00:47:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-17 00:47:22 +0200 |
commit | 4dd8bae5c91fa4aef09d865d8fef1acd84f90925 (patch) | |
tree | ffad9b242daccaf8c86d1c1fbd59032302bd3be9 /vendor/github.com/mattermost/mattermost-server/v5/utils/jsonutils/json.go | |
parent | 7ae45c42e712bd0e66c101f3f714c05aa1dc2104 (diff) | |
download | matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.gz matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.bz2 matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.zip |
Update dependencies (#1610)
* Update dependencies
* Update module to go 1.17
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v5/utils/jsonutils/json.go')
-rw-r--r-- | vendor/github.com/mattermost/mattermost-server/v5/utils/jsonutils/json.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v5/utils/jsonutils/json.go b/vendor/github.com/mattermost/mattermost-server/v5/utils/jsonutils/json.go index 4651ec87..9d5e7872 100644 --- a/vendor/github.com/mattermost/mattermost-server/v5/utils/jsonutils/json.go +++ b/vendor/github.com/mattermost/mattermost-server/v5/utils/jsonutils/json.go @@ -10,34 +10,34 @@ import ( "github.com/pkg/errors" ) -type HumanizedJsonError struct { +type HumanizedJSONError struct { Err error Line int Character int } -func (e *HumanizedJsonError) Error() string { +func (e *HumanizedJSONError) Error() string { return e.Err.Error() } -// HumanizeJsonError extracts error offsets and annotates the error with useful context -func HumanizeJsonError(err error, data []byte) error { +// HumanizeJSONError extracts error offsets and annotates the error with useful context +func HumanizeJSONError(err error, data []byte) error { if syntaxError, ok := err.(*json.SyntaxError); ok { - return NewHumanizedJsonError(syntaxError, data, syntaxError.Offset) + return NewHumanizedJSONError(syntaxError, data, syntaxError.Offset) } else if unmarshalError, ok := err.(*json.UnmarshalTypeError); ok { - return NewHumanizedJsonError(unmarshalError, data, unmarshalError.Offset) + return NewHumanizedJSONError(unmarshalError, data, unmarshalError.Offset) } else { return err } } -func NewHumanizedJsonError(err error, data []byte, offset int64) *HumanizedJsonError { +func NewHumanizedJSONError(err error, data []byte, offset int64) *HumanizedJSONError { if err == nil { return nil } if offset < 0 || offset > int64(len(data)) { - return &HumanizedJsonError{ + return &HumanizedJSONError{ Err: errors.Wrapf(err, "invalid offset %d", offset), } } @@ -48,7 +48,7 @@ func NewHumanizedJsonError(err error, data []byte, offset int64) *HumanizedJsonE lastLineOffset := bytes.LastIndex(data[:offset], lineSep) character := int(offset) - (lastLineOffset + 1) + 1 - return &HumanizedJsonError{ + return &HumanizedJSONError{ Line: line, Character: character, Err: errors.Wrapf(err, "parsing error at line %d, character %d", line, character), |