MCPcopy Create free account

hub / github.com/creasty/defaults / types & classes

Types & classes149 in github.com/creasty/defaults

↓ 2 callersTypeAliasmyDuration
set_duration_test.go:15
↓ 2 callersTypeAliasumJSONEnum
umJSONEnum implements json.Unmarshaler only, so it exercises the JSON branch of the unmarshal-by-interface path. All types in this file are package-le
set_unmarshaler_test.go:21
↓ 2 callersTypeAliasumLevelTextAndSetter
umLevelTextAndSetter is a non-struct type with a text form and a setter. Behind a pointer its setter is called from the pointer branch of setField, wh
set_unmarshaler_test.go:68
↓ 1 callersTypeAliasSetterLevel
SetterLevel is a non-struct type with a setter. The struct recursion never reaches it, so behind a pointer its only call is the one the pointer branch
setter_test.go:74
↓ 1 callersTypeAliasbenchJSON
benchJSON takes every tag and stores its length.
benchmark_test.go:664
↓ 1 callersTypeAliasbenchText
benchText takes every tag and stores its length.
benchmark_test.go:656
↓ 1 callersTypeAliasmyString
set_pointer_test.go:13
↓ 1 callersTypeAliasnodePtr
set_cycle_test.go:71
↓ 1 callersTypeAliasumFailingJSON
umFailingJSON always fails, so Set has to fall back to parsing by kind.
set_unmarshaler_test.go:121
↓ 1 callersTypeAliasumFailingText
umFailingText always fails, so Set has to fall back to parsing by kind.
set_unmarshaler_test.go:114
StructClient
example_test.go:102
StructConfig
Config implements defaults.Setter for ExampleSetter below.
example_test.go:13
StructEmbedded
set_nesting_test.go:17
StructEndpoint
Endpoint implements defaults.Setter for Example below.
example_test.go:27
StructGateway
example_test.go:43
StructInner
set_struct_test.go:95
StructMiddle
setter_test.go:369
StructOptOutSetter
OptOutSetter records whether its setter ran, so a test can tell whether `default:"-"` suppresses the setter along with the tags. It is package-level o
set_optout_test.go:15
StructRetry
example_test.go:99
StructServer
example_test.go:76
InterfaceSetter
Setter is an interface for setting default values. Set calls SetDefaults on a struct once it has filled the struct's fields, and again for every othe
setter.go:13
StructSetterCounter
SetterCounter counts its own invocations. Its name is exported because it is embedded below, for the same reason as SetterInner's.
setter_test.go:37
StructSetterInner
SetterInner is embedded by pointer below, which is why its name is exported: an embedded field takes the name of its type, and an unexported one would
setter_test.go:47
StructTagged
set_struct_test.go:76
StructUmTextAndSetter
UmTextAndSetter implements encoding.TextUnmarshaler and defaults.Setter, and appends to Via as each one runs, so a test can tell "only text ran" from
set_unmarshaler_test.go:53
StructUntagged
set_struct_test.go:79
Structarray
set_unmarshaler_test.go:447
Structbad
set_error_test.go:181
Structbad
set_pointer_test.go:225
StructbadSlice
set_error_test.go:72
TypeAliasbenchRejecting
benchRejecting rejects every tag from both unmarshalers, so parsing by kind takes it. The rejection is an error that already exists, so it allocates n
benchmark_test.go:673
StructbenchRejectingStruct
benchRejectingStruct rejects every tag, and is a struct, so encoding/json is tried next.
benchmark_test.go:680
StructbenchSetterItem
benchSetterItem has a SetDefaults that does nothing, so Set leaves a filled one as it is.
benchmark_test.go:687
Structboth
set_unmarshaler_test.go:412
Structchild
set_pointer_test.go:126
StructcomplexNumber
set_unmarshaler_test.go:456
StructcycleCounter
cycleCounter counts its setter's calls, so a test can tell how many times the walk reached it. It is package-level only because it needs a method.
set_cycle_test.go:14
StructemptyTagNode
An empty tag still allocates a pointer, so it recurses like any other.
set_recursion_test.go:30
StructfieldTag
fieldTag is the `default` tag as it applies to one field: the field's name, for error messages, the tag's value, and whether the tag was present at al
set.go:25
Structflagged
benchmark_test.go:451
StructindexEntry
indexEntry is an entry the path's index holds: its key, and the next entry in its bucket.
path.go:147
Structinner
set_unexported_test.go:40
Structinner
set_scalar_test.go:467
Structinner
set_preserve_test.go:61
Structinner
set_pointer_test.go:42
Structinner
set_slice_test.go:79
Structinner
set_struct_test.go:13
Structinner
set_optout_test.go:62
Structinner
set_map_test.go:65
Structinner
benchmark_test.go:50
Structint64Kind
set_unmarshaler_test.go:415
Structitem
benchmark_test.go:261
StructjsonOnly
set_unmarshaler_test.go:409
Structleaf
set_recursion_test.go:140
Structleaf
benchmark_test.go:222
Structleaf
set_nesting_test.go:20
Structlink
benchmark_test.go:307
TypeAliasloop
set_cycle_test.go:83
StructmapKeyHook
mapKeyHook runs hook when Set calls its setter, so a test can change the map holding it while Set walks that map. It is package-level only because it
set_map_test.go:217
StructmapNode
set_recursion_test.go:26
StructmethodEmbedsInterface
method_test.go:50
StructmethodEmbedsPointerField
methodEmbedsPointerField embeds a pointer, and takes the method through it.
method_test.go:36
StructmethodEmbedsPointerReceiver
methodEmbedsPointerReceiver embeds a value whose method has a pointer receiver, so the method is in the embedding pointer's set alone.
method_test.go:33
StructmethodEmbedsTwice
methodEmbedsTwice takes it from a field that took it from a field.
method_test.go:39
StructmethodEmbedsValue
methodEmbedsValue takes it from a field, promoted.
method_test.go:29
InterfacemethodPinger
methodPinger is embedded as an interface, so the method is promoted from a field that holds it.
method_test.go:48
StructmethodPointer
methodPointer declares it on a pointer receiver, so only a pointer to it has the method.
method_test.go:24
StructmethodShadows
methodShadows declares its own over the one it would take from its field, and calls through to it, as a type that means to add to an embedded method d
method_test.go:43
StructmethodValue
This test is in package defaults rather than defaults_test: isPromotedMethod is unexported, and Set reaches it only with a struct, a setter and a walk
method_test.go:19
Structmid
benchmark_test.go:225
TypeAliasmyBool
set_scalar_test.go:297
TypeAliasmyFloat32
set_scalar_test.go:295
TypeAliasmyFloat64
set_scalar_test.go:296
TypeAliasmyInt
set_scalar_test.go:284
TypeAliasmyInt16
set_scalar_test.go:286
TypeAliasmyInt32
set_scalar_test.go:287
TypeAliasmyInt64
set_scalar_test.go:288
TypeAliasmyInt8
set_scalar_test.go:285
TypeAliasmyMap
set_map_test.go:37
TypeAliasmySlice
set_slice_test.go:53
TypeAliasmyString
set_scalar_test.go:298
TypeAliasmyUint
set_scalar_test.go:289
TypeAliasmyUint16
set_scalar_test.go:291
TypeAliasmyUint32
set_scalar_test.go:292
TypeAliasmyUint64
set_scalar_test.go:293
TypeAliasmyUint8
set_scalar_test.go:290
TypeAliasmyUintptr
set_scalar_test.go:294
Structnode
set_cycle_test.go:31
Structnode
set_shared_test.go:89
Structnode
set_recursion_test.go:76
Structnode
benchmark_test.go:362
StructoptOutRoot
optOutRoot is the documented way to give an opted-out field a dynamic default: the tag says "hands off", and the struct's own setter fills it in.
set_optout_test.go:26
Structpair
set_recursion_test.go:143
Structparent
set_pointer_test.go:130
Structpartly
set_error_test.go:184
StructpathIndex
pathIndex is the index of a path too deep to scan: the entries at the top of the path, down to some depth, and a hash table of their keys. Entries joi
path.go:140
StructpathKey
pathKey names an entry in the path's index by its address, its type and its length. They are held as uintptrs, not pointers: a pointer read off an ent
path.go:117
StructpendingDefault
pendingDefault is a tag being applied to a zero value further up the current path, linked to the one being applied above it.
set.go:33
Structpoint
set_error_test.go:177
Structpointer
set_unmarshaler_test.go:450
next →1–100 of 149, ranked by callers