MCPcopy Create free account
hub / github.com/DoNewsCode/core / Example_minimum

Function Example_minimum

config/example_test.go:14–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12)
13
14func Example_minimum() {
15 conf, _ := config.NewConfig(
16 config.WithProviderLayer(
17 rawbytes.Provider([]byte(`{"foo": "bar"}`)), json.Parser(),
18 ),
19 )
20 fmt.Println(conf.String("foo"))
21 // Output:
22 // bar
23}
24
25func Example_configurationStack() {
26 fs := flag.NewFlagSet("config", flag.ContinueOnError)

Callers

nothing calls this directly

Calls 3

NewConfigFunction · 0.92
WithProviderLayerFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected