MCPcopy
hub / github.com/git-lfs/git-lfs / GetContext

Function GetContext

errors/context.go:20–25  ·  view source on GitHub ↗

ErrorGetContext gets a value from the error's context. If the error has not been wrapped, it returns an empty string.

(err error, key string)

Source from the content-addressed store, hash-verified

18// ErrorGetContext gets a value from the error's context. If the error has not
19// been wrapped, it returns an empty string.
20func GetContext(err error, key string) interface{} {
21 if e, ok := err.(withContext); ok {
22 return e.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.

Callers 3

cleanFunction · 0.92
TestContextOnGoErrorsFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by 2

TestContextOnGoErrorsFunction · 0.68