MCPcopy Create free account

hub / github.com/creasty/defaults / functions

Functions146 in github.com/creasty/defaults

FunctionTestSet_SliceOfMapOfSliceOfStructs
(t *testing.T)
set_nesting_test.go:54
FunctionTestSet_SliceOfPointersFromTag
(t *testing.T)
set_slice_test.go:37
FunctionTestSet_SliceOfScalarsIsLeftAlone
TestSet_SliceOfScalarsIsLeftAlone pins that elements of a scalar slice are never rewritten: a zero element is not a field with a tag, so nothing appli
set_slice_test.go:133
FunctionTestSet_SliceOfStructsFromTag
(t *testing.T)
set_slice_test.go:78
FunctionTestSet_SliceTagJSON
(t *testing.T)
set_slice_test.go:24
FunctionTestSet_SliceTagOverridesElementDefault
TestSet_SliceTagOverridesElementDefault covers precedence between a parent's tag and a child's own default: the parent wins.
set_slice_test.go:97
FunctionTestSet_String
(t *testing.T)
set_scalar_test.go:70
FunctionTestSet_StructTagEmptyObject
(t *testing.T)
set_struct_test.go:13
FunctionTestSet_StructTagJSON
(t *testing.T)
set_struct_test.go:28
FunctionTestSet_StructTagJSONWins
TestSet_StructTagJSONWins covers precedence: what the parent's JSON provides is not overwritten by the child's own default.
set_struct_test.go:45
FunctionTestSet_TextUnmarshaler
(t *testing.T)
set_unmarshaler_test.go:92
FunctionTestSet_TextUnmarshalerPointer
(t *testing.T)
set_unmarshaler_test.go:103
FunctionTestSet_TextUnmarshalerWinsOverJSON
TestSet_TextUnmarshalerWinsOverJSON pins the precedence between the two interfaces.
set_unmarshaler_test.go:129
FunctionTestSet_TextUnmarshalerWinsOverSetter
TestSet_TextUnmarshalerWinsOverSetter pins the precedence the README claims. A successful UnmarshalText returns out of setField ahead of the recursion
set_unmarshaler_test.go:145
FunctionTestSet_TimeTime
TestSet_TimeTime covers the stdlib struct most likely to carry a default tag. It reaches time.Time's UnmarshalText, and a value that does not parse is
set_unmarshaler_test.go:240
FunctionTestSet_UnexportedCompositeFieldsAreSkippedWholesale
TestSet_UnexportedCompositeFieldsAreSkippedWholesale pins how far the CanSet guard reaches: an unexported field is skipped whatever its type, so a who
set_struct_test.go:138
FunctionTestSet_UnexportedFieldsAreSkipped
TestSet_UnexportedFieldsAreSkipped pins that an unexported field is untouched even with a tag (reflect cannot set it), and that its presence does not
set_scalar_test.go:412
FunctionTestSet_UnmarshalerNeedsANonEmptyTag
TestSet_UnmarshalerNeedsANonEmptyTag pins that neither interface is consulted for an empty tag, so a type that could unmarshal anything gets nothing f
set_unmarshaler_test.go:267
FunctionTestSet_UnparsableValuesAreRejected
TestSet_UnparsableValuesAreRejected covers a value the field's kind cannot parse: Set now returns an error naming the field, where it used to leave th
set_scalar_test.go:285
FunctionTestSet_UnsignedIntegers
(t *testing.T)
set_scalar_test.go:29
FunctionTestSet_UnsupportedKindsAreIgnored
TestSet_UnsupportedKindsAreIgnored pins that kinds setField has no case for are left alone, tag or no tag, without an error.
set_scalar_test.go:393
FunctionTestSet_UntaggedMapStaysNil
(t *testing.T)
set_map_test.go:50
FunctionTestSet_UntaggedPointerStaysNil
(t *testing.T)
set_pointer_test.go:105
FunctionTestSet_UntaggedPointerStructRecurses
TestSet_UntaggedPointerStructRecurses covers the pointer a caller has already allocated: even with no tag, Set descends into it and fills its fields.
set_pointer_test.go:125
FunctionTestSet_UntaggedSliceStaysNil
(t *testing.T)
set_slice_test.go:67
FunctionTestSet_UntaggedStructRecurses
(t *testing.T)
set_struct_test.go:59
FunctionTestSet_WellFormedJSONOfTheWrongShape
TestSet_WellFormedJSONOfTheWrongShape covers the other way decoding fails: valid JSON that cannot land in the field's type. It surfaces as *json.Unmar
set_error_test.go:168
FunctionTestSet_WhitespaceTagIsNotEmpty
TestSet_WhitespaceTagIsNotEmpty pins that a stray space is a value rather than an absence: a string takes it verbatim, and every container tries to de
set_error_test.go:182
FunctionTestSetter_CalledOnMapElements
(t *testing.T)
setter_test.go:126
FunctionTestSetter_CalledOnMapPointerElements
(t *testing.T)
setter_test.go:137
FunctionTestSetter_CalledOnPointerField
(t *testing.T)
setter_test.go:99
FunctionTestSetter_CalledOnPointerToNonStruct
(t *testing.T)
setter_test.go:254
FunctionTestSetter_CalledOnRoot
(t *testing.T)
setter_test.go:79
FunctionTestSetter_CalledOnSliceElements
(t *testing.T)
setter_test.go:111
FunctionTestSetter_CalledOnStructField
(t *testing.T)
setter_test.go:88
FunctionTestSetter_CanUpdateGuardPreservesCallerValue
(t *testing.T)
setter_test.go:162
FunctionTestSetter_EmbeddedPointerStruct
(t *testing.T)
setter_test.go:173
FunctionTestSetter_InvocationCount
TestSetter_InvocationCount pins how many times Set calls a setter for each shape. A pointer field gets two calls — once from the Set recursion, once f
setter_test.go:191
FunctionTestSetter_OverwritesCallerValueWhenUnguarded
TestSetter_OverwritesCallerValueWhenUnguarded pins that a setter is trusted absolutely: unlike a tag, it is not checked against the field's current va
setter_test.go:151
FunctionTestSetter_RunsAgainOnASecondSet
TestSetter_RunsAgainOnASecondSet pins that Set is not idempotent as far as setters go: calling it twice calls them twice over, which is the other half
setter_test.go:279
MethodUnmarshalJSON
(b []byte)
set_unmarshaler_test.go:21
MethodUnmarshalJSON
(b []byte)
set_unmarshaler_test.go:43
MethodUnmarshalJSON
([]byte)
set_unmarshaler_test.go:88
MethodUnmarshalText
(text []byte)
set_unmarshaler_test.go:54
MethodUnmarshalText
([]byte)
set_unmarshaler_test.go:81
Functionmain
()
example/main.go:49
← previous101–146 of 146, ranked by callers