MCPcopy Create free account
hub / github.com/bracesdev/errtrace / insertWrapAssign

Struct insertWrapAssign

cmd/errtrace/main.go:1144–1147  ·  view source on GitHub ↗

insertWrapAssign wraps a variable in-place with an errtrace.Wrap call. This is used for naked returns in functions with named return values For example, it will turn this: func foo() (err error) { // ... return } Into this: func foo() (err error) { // ... err = errtrace.Wrap(err); ret

Source from the content-addressed store, hash-verified

1142// err = errtrace.Wrap(err); return
1143// }
1144type insertWrapAssign struct {
1145 Names []string // names of variables to wrap
1146 Before token.Pos // position to insert before
1147}
1148
1149func (e *insertWrapAssign) Pos() token.Pos {
1150 return e.Before

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected