fix manager generic constraints

This commit is contained in:
Elijah Duffy
2025-06-02 17:52:12 -07:00
parent 130903a835
commit 0b7c857070

View File

@@ -11,7 +11,7 @@ import (
)
// Manager is the top-level configuration schema and viper instance.
type Manager[T struct{}] struct {
type Manager[T any] struct {
// PreLoad is an optional function that is called before loading the
// configuration file.
PreLoad func(*Manager[T]) error
@@ -37,7 +37,7 @@ type Manager[T struct{}] struct {
// NewManager creates a new configuration manager for schema T. Fields in T are
// responsible for including any necessary `mapstructure` and `validate` tags
// to ensure proper unmarshalling and validation of the configuration schema.
func NewManager[T struct{}](configName, configType, configPath string) *Manager[T] {
func NewManager[T any](configName, configType, configPath string) *Manager[T] {
m := &Manager[T]{
viper: viper.New(),
}