From 74209da9580c7ae63898664437dc7d021010d29a Mon Sep 17 00:00:00 2001 From: Bobby <30593201+luciferreeves@users.noreply.github.com> Date: Thu, 18 Dec 2025 16:29:07 +0530 Subject: add config and makefile --- utils/env/validators.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 utils/env/validators.go (limited to 'utils/env/validators.go') diff --git a/utils/env/validators.go b/utils/env/validators.go new file mode 100644 index 0000000..fa9b17f --- /dev/null +++ b/utils/env/validators.go @@ -0,0 +1,15 @@ +package env + +import ( + "fmt" + "reflect" +) + +func validateConfigInput(config any) (reflect.Value, reflect.Type, error) { + v := reflect.ValueOf(config) + if v.Kind() != reflect.Pointer || v.Elem().Kind() != reflect.Struct { + return reflect.Value{}, nil, fmt.Errorf("config must be a pointer to struct") + } + elem := v.Elem() + return elem, elem.Type(), nil +} -- cgit v1.2.3