| 1 | package errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/ |
| 2 | |
| 3 | type withContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext# interface { |
| 4 | Setscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#Set.(string, interface{}) |
| 5 | Getscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#Get.(string) interface{} |
| 6 | Delscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#Del.(string) |
| 7 | Contextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#Context.() map[string]interface{} |
| 8 | } |
| 9 | |
| 10 | // ErrorSetContext sets a value in the error's context. If the error has not |
| 11 | // been wrapped, it does nothing. |
| 12 | func SetContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/SetContext().(err error, key string, value interface{}) { |
| 13 | if e, ok := err.(withContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#); ok { |
| 14 | e.Setscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#Set.(key, value) |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | // ErrorGetContext gets a value from the error's context. If the error has not |
| 19 | // been wrapped, it returns an empty string. |
| 20 | func GetContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/GetContext().(err error, key string) interface{} { |
| 21 | if e, ok := err.(withContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#); ok { |
| 22 | return e.Getscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#Get.(key) |
| 23 | } |
| 24 | return "" |
| 25 | } |
| 26 | |
| 27 | // ErrorDelContext removes a value from the error's context. If the error has |
| 28 | // not been wrapped, it does nothing. |
| 29 | func DelContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/DelContext().(err error, key string) { |
| 30 | if e, ok := err.(withContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#); ok { |
| 31 | e.Delscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#Del.(key) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // ErrorContext returns the context map for an error if it is a wrappedError. |
| 36 | // If it is not a wrappedError it will return an empty map. |
| 37 | func Contextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Context().(err error) map[string]interface{} { |
| 38 | if e, ok := err.(withContextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#); ok { |
| 39 | return e.Contextscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/withContext#Context.() |
| 40 | } |
| 41 | return nil |
| 42 | } |