Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/creasty/defaults
/ functions
Functions
146 in github.com/creasty/defaults
⨍
Functions
146
◇
Types & classes
72
Function
TestSet_SliceOfMapOfSliceOfStructs
(t *testing.T)
set_nesting_test.go:54
Function
TestSet_SliceOfPointersFromTag
(t *testing.T)
set_slice_test.go:37
Function
TestSet_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
Function
TestSet_SliceOfStructsFromTag
(t *testing.T)
set_slice_test.go:78
Function
TestSet_SliceTagJSON
(t *testing.T)
set_slice_test.go:24
Function
TestSet_SliceTagOverridesElementDefault
TestSet_SliceTagOverridesElementDefault covers precedence between a parent's tag and a child's own default: the parent wins.
set_slice_test.go:97
Function
TestSet_String
(t *testing.T)
set_scalar_test.go:70
Function
TestSet_StructTagEmptyObject
(t *testing.T)
set_struct_test.go:13
Function
TestSet_StructTagJSON
(t *testing.T)
set_struct_test.go:28
Function
TestSet_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
Function
TestSet_TextUnmarshaler
(t *testing.T)
set_unmarshaler_test.go:92
Function
TestSet_TextUnmarshalerPointer
(t *testing.T)
set_unmarshaler_test.go:103
Function
TestSet_TextUnmarshalerWinsOverJSON
TestSet_TextUnmarshalerWinsOverJSON pins the precedence between the two interfaces.
set_unmarshaler_test.go:129
Function
TestSet_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
Function
TestSet_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
Function
TestSet_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
Function
TestSet_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
Function
TestSet_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
Function
TestSet_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
Function
TestSet_UnsignedIntegers
(t *testing.T)
set_scalar_test.go:29
Function
TestSet_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
Function
TestSet_UntaggedMapStaysNil
(t *testing.T)
set_map_test.go:50
Function
TestSet_UntaggedPointerStaysNil
(t *testing.T)
set_pointer_test.go:105
Function
TestSet_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
Function
TestSet_UntaggedSliceStaysNil
(t *testing.T)
set_slice_test.go:67
Function
TestSet_UntaggedStructRecurses
(t *testing.T)
set_struct_test.go:59
Function
TestSet_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
Function
TestSet_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
Function
TestSetter_CalledOnMapElements
(t *testing.T)
setter_test.go:126
Function
TestSetter_CalledOnMapPointerElements
(t *testing.T)
setter_test.go:137
Function
TestSetter_CalledOnPointerField
(t *testing.T)
setter_test.go:99
Function
TestSetter_CalledOnPointerToNonStruct
(t *testing.T)
setter_test.go:254
Function
TestSetter_CalledOnRoot
(t *testing.T)
setter_test.go:79
Function
TestSetter_CalledOnSliceElements
(t *testing.T)
setter_test.go:111
Function
TestSetter_CalledOnStructField
(t *testing.T)
setter_test.go:88
Function
TestSetter_CanUpdateGuardPreservesCallerValue
(t *testing.T)
setter_test.go:162
Function
TestSetter_EmbeddedPointerStruct
(t *testing.T)
setter_test.go:173
Function
TestSetter_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
Function
TestSetter_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
Function
TestSetter_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
Method
UnmarshalJSON
(b []byte)
set_unmarshaler_test.go:21
Method
UnmarshalJSON
(b []byte)
set_unmarshaler_test.go:43
Method
UnmarshalJSON
([]byte)
set_unmarshaler_test.go:88
Method
UnmarshalText
(text []byte)
set_unmarshaler_test.go:54
Method
UnmarshalText
([]byte)
set_unmarshaler_test.go:81
Function
main
()
example/main.go:49
← previous
101–146 of 146, ranked by callers