Field Returns the field and context the error occurred.
()
| 90 | |
| 91 | // Field Returns the field and context the error occurred. |
| 92 | func (e invalidParamError) Field() string { |
| 93 | sb := &strings.Builder{} |
| 94 | sb.WriteString(e.context) |
| 95 | if sb.Len() > 0 { |
| 96 | if len(e.nestedContext) == 0 || (len(e.nestedContext) > 0 && e.nestedContext[:1] != "[") { |
| 97 | sb.WriteRune('.') |
| 98 | } |
| 99 | } |
| 100 | if len(e.nestedContext) > 0 { |
| 101 | sb.WriteString(e.nestedContext) |
| 102 | sb.WriteRune('.') |
| 103 | } |
| 104 | sb.WriteString(e.field) |
| 105 | return sb.String() |
| 106 | } |
| 107 | |
| 108 | // SetContext updates the base context of the error. |
| 109 | func (e *invalidParamError) SetContext(ctx string) { |
no test coverage detected