Skip to content

Commit 8539858

Browse files
committed
refactor: Remove unused LoadFromFunc and FillFromFunc functions from conf.go
1 parent a42b5f9 commit 8539858

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

conf.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ func LoadWithContext[T any](ctx context.Context, provider provider.Provider, cod
2121
return &config, nil
2222
}
2323

24-
// LoadFromFunc creates a provider using the given factory function, then reads configuration from it
25-
func LoadFromFunc[T any](factory func() (provider.Provider, error), codec codec.Codec) (*T, error) {
26-
p, err := factory()
27-
if err != nil {
28-
return nil, err
29-
}
30-
return Load[T](p, codec)
31-
}
32-
3324
// Load reads configuration from the given provider and unmarshal it into the provided struct.
3425
func Load[T any](provider provider.Provider, codec codec.Codec) (*T, error) {
3526
return LoadWithContext[T](context.Background(), provider, codec)
@@ -44,15 +35,6 @@ func FillWithContext(ctx context.Context, provider provider.Provider, codec code
4435
return codec.Unmarshal(data, config)
4536
}
4637

47-
// FillFromFunc creates a provider using the given factory function, then reads configuration from it
48-
func FillFromFunc(factory func() (provider.Provider, error), codec codec.Codec, config any) error {
49-
p, err := factory()
50-
if err != nil {
51-
return err
52-
}
53-
return Fill(p, codec, config)
54-
}
55-
5638
// Fill reads configuration from the given provider and unmarshal it into the provided struct.
5739
func Fill(provider provider.Provider, codec codec.Codec, config any) error {
5840
return FillWithContext(context.Background(), provider, codec, config)

0 commit comments

Comments
 (0)