AddNestedContext prepends a context to the field's path.
(ctx string)
| 112 | |
| 113 | // AddNestedContext prepends a context to the field's path. |
| 114 | func (e *invalidParamError) AddNestedContext(ctx string) { |
| 115 | if len(e.nestedContext) == 0 { |
| 116 | e.nestedContext = ctx |
| 117 | return |
| 118 | } |
| 119 | // Check if our nested context is an index into a slice or map |
| 120 | if e.nestedContext[:1] != "[" { |
| 121 | e.nestedContext = fmt.Sprintf("%s.%s", ctx, e.nestedContext) |
| 122 | return |
| 123 | } |
| 124 | e.nestedContext = ctx + e.nestedContext |
| 125 | } |
| 126 | |
| 127 | // An ParamRequiredError represents an required parameter error. |
| 128 | type ParamRequiredError struct { |
nothing calls this directly
no outgoing calls
no test coverage detected