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

Function SetContext

errors/context.go:12–16  ·  view source on GitHub ↗

ErrorSetContext sets a value in the error's context. If the error has not been wrapped, it does nothing.

(err error, key string, value interface{})

Source from the content-addressed store, hash-verified

10// ErrorSetContext sets a value in the error's context. If the error has not
11// been wrapped, it does nothing.
12func SetContext(err error, key string, value interface{}) {
13 if e, ok := err.(withContext); ok {
14 e.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.

Callers 4

TestContextOnGoErrorsFunction · 0.85
NewSmudgeErrorFunction · 0.85
NewCleanPointerErrorFunction · 0.85

Calls 1

SetMethod · 0.65

Tested by 2

TestContextOnGoErrorsFunction · 0.68