Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/creasty/defaults
/ functions
Functions
250 in github.com/creasty/defaults
⨍
Functions
250
◇
Types & classes
149
Function
TestSetter_CalledOnPointerToNonStruct
TestSetter_CalledOnPointerToNonStruct pins the setter calls a non-struct type gets: one behind a pointer the tag allocated, unless its unmarshaler too
setter_test.go:388
Function
TestSetter_CalledOnRoot
(t *testing.T)
setter_test.go:100
Function
TestSetter_CalledOnSliceElements
(t *testing.T)
setter_test.go:132
Function
TestSetter_CalledOnStructField
(t *testing.T)
setter_test.go:109
Function
TestSetter_CalledOnValueReceiver
TestSetter_CalledOnValueReceiver pins that a setter declared on a value receiver is called. The pointer's method set lists it as a wrapper the compile
setter_test.go:435
Function
TestSetter_CanUpdateGuardPreservesCallerValue
(t *testing.T)
setter_test.go:183
Function
TestSetter_EmbeddedPointerStruct
TestSetter_EmbeddedPointerStruct pins that a struct's own setter and an embedded one both run. setterOuter declares a SetDefaults, which hides SetterI
setter_test.go:198
Function
TestSetter_InvocationCount
TestSetter_InvocationCount pins how many times Set calls a setter for each shape below: once. A struct behind a pointer used to get a second call, fr
setter_test.go:264
Function
TestSetter_NotCalledThroughEmbeddedInterface
TestSetter_NotCalledThroughEmbeddedInterface pins that an embedded interface gets no setter, the same as a named one. Go promotes the interface's SetD
setter_test.go:228
Function
TestSetter_NotCalledThroughNilEmbeddedPointer
TestSetter_NotCalledThroughNilEmbeddedPointer pins that an untagged nil embedded pointer gets no setter, the same as a named one. Go promotes the sett
setter_test.go:211
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:172
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 why a setter h
setter_test.go:458
Function
TestUnmarshalTag_NotOffered
TestUnmarshalTag_NotOffered covers the values an unmarshaler is not asked about at all, which leave the target as it was and report no error: there is
unmarshal_test.go:155
Function
TestUnmarshalTag_Rejected
TestUnmarshalTag_Rejected covers what the caller reports when neither took the value: UnmarshalText's rejection, since it was asked first, and Unmarsh
unmarshal_test.go:133
Function
TestUnmarshalTag_Taken
TestUnmarshalTag_Taken covers a value one of the target's unmarshalers takes, which is the whole point of offering it: the caller parses nothing itsel
unmarshal_test.go:85
Function
TestUnmarshalTag_TextIsAskedFirst
TestUnmarshalTag_TextIsAskedFirst covers the order: a target that implements both is asked through UnmarshalText, and UnmarshalJSON is never offered t
unmarshal_test.go:119
Function
TestWalking_KeyNamesTheValueItsTypeAndItsLength
TestWalking_KeyNamesTheValueItsTypeAndItsLength covers what an entry is to the index: two entries have one key only if they name the same value, under
path_test.go:163
Function
TestWalking_LeaveTakesOnlyItsOwnEntryOut
TestWalking_LeaveTakesOnlyItsOwnEntryOut covers what leave does as a walk returns, called as it is on every return, including one the index never held
path_test.go:139
Function
TestWalking_RepeatsFarIndexesThePathAboveIt
TestWalking_RepeatsFarIndexesThePathAboveIt covers the first check below scanDepth: it makes the index, gives it to every entry on the path, and adds
path_test.go:117
Function
TestWalking_RepeatsNearFindsTheSameValueAbove
TestWalking_RepeatsNearFindsTheSameValueAbove covers the scan, which a value no more than scanDepth down is checked by: the whole path above it, for a
path_test.go:85
Function
TestWalking_RepeatsNearLeavesDeeperValuesToRepeatsFar
TestWalking_RepeatsNearLeavesDeeperValuesToRepeatsFar covers the split between the two: the scan gives up below scanDepth, where it would cost more th
path_test.go:104
Method
UnmarshalJSON
(data []byte)
unmarshal_test.go:31
Method
UnmarshalJSON
(data []byte)
unmarshal_test.go:47
Method
UnmarshalJSON
(data []byte)
unmarshal_test.go:60
Method
UnmarshalJSON
([]byte)
unmarshal_test.go:73
Method
UnmarshalJSON
([]byte)
unmarshal_test.go:78
Method
UnmarshalJSON
(b []byte)
set_unmarshaler_test.go:23
Method
UnmarshalJSON
(b []byte)
set_unmarshaler_test.go:45
Method
UnmarshalJSON
(b []byte)
set_unmarshaler_test.go:84
Method
UnmarshalJSON
(b []byte)
set_unmarshaler_test.go:93
Method
UnmarshalJSON
([]byte)
set_unmarshaler_test.go:123
Method
UnmarshalJSON
([]byte)
set_unmarshaler_test.go:135
Method
UnmarshalJSON
([]byte)
set_unmarshaler_test.go:192
Method
UnmarshalJSON
([]byte)
benchmark_test.go:677
Method
UnmarshalText
(text []byte)
unmarshal_test.go:23
Method
UnmarshalText
(text []byte)
unmarshal_test.go:42
Method
UnmarshalText
([]byte)
unmarshal_test.go:58
Method
UnmarshalText
([]byte)
unmarshal_test.go:71
Method
UnmarshalText
(text []byte)
set_unmarshaler_test.go:57
Method
UnmarshalText
(text []byte)
set_unmarshaler_test.go:70
Method
UnmarshalText
([]byte)
set_unmarshaler_test.go:116
Method
UnmarshalText
([]byte)
set_unmarshaler_test.go:131
Method
UnmarshalText
([]byte)
set_unmarshaler_test.go:143
Method
UnmarshalText
(text []byte)
set_unmarshaler_test.go:153
Method
UnmarshalText
(text []byte)
set_unmarshaler_test.go:166
Method
UnmarshalText
(text []byte)
set_unmarshaler_test.go:181
Method
UnmarshalText
([]byte)
set_unmarshaler_test.go:199
Method
UnmarshalText
([]byte)
benchmark_test.go:675
Method
UnmarshalText
([]byte)
benchmark_test.go:684
Function
benchFail
benchFail measures a Set on a zero T that fails. valid checks the first error.
benchmark_test.go:600
← previous
201–250 of 250, ranked by callers