MCPcopy Create free account
hub / github.com/aws/smithy-go / Field

Method Field

validation.go:92–106  ·  view source on GitHub ↗

Field Returns the field and context the error occurred.

()

Source from the content-addressed store, hash-verified

90
91// Field Returns the field and context the error occurred.
92func (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.
109func (e *invalidParamError) SetContext(ctx string) {

Callers 1

ErrorMethod · 0.95

Calls 4

WriteStringMethod · 0.65
WriteRuneMethod · 0.65
StringMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected