MCPcopy Create free account
hub / github.com/cogentcore/core / SetFromDefaults

Function SetFromDefaults

cli/defaults.go:15–17  ·  view source on GitHub ↗

SetFromDefaults sets the values of the given config object from `default:` struct field tag values. Errors are automatically logged in addition to being returned.

(cfg any)

Source from the content-addressed store, hash-verified

13// from `default:` struct field tag values. Errors are automatically
14// logged in addition to being returned.
15func SetFromDefaults(cfg any) error {
16 return errors.Log(reflectx.SetFromDefaultTags(cfg))
17}

Callers 8

TestGenerateFunction · 0.92
TestAppleBuildFunction · 0.92
TestNdkRootFunction · 0.92
TestGenerateFunction · 0.92
configFunction · 0.85
TestDefaultsFunction · 0.85
TestSetFromArgsFunction · 0.85
TestSetFromArgsErrFunction · 0.85

Calls 2

LogFunction · 0.92
SetFromDefaultTagsFunction · 0.92

Tested by 7

TestGenerateFunction · 0.74
TestAppleBuildFunction · 0.74
TestNdkRootFunction · 0.74
TestGenerateFunction · 0.74
TestDefaultsFunction · 0.68
TestSetFromArgsFunction · 0.68
TestSetFromArgsErrFunction · 0.68