From 0b7c857070a5f748653b880458c2a6844ff052f4 Mon Sep 17 00:00:00 2001 From: Elijah Duffy Date: Mon, 2 Jun 2025 17:52:12 -0700 Subject: [PATCH] fix manager generic constraints --- config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index 75d45d4..8492e2c 100644 --- a/config.go +++ b/config.go @@ -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(), }