|
@@ -1,6 +1,9 @@
|
|
|
package reflection
|
|
|
|
|
|
-import "git.nspix.com/golang/kos/util/reflect"
|
|
|
+import (
|
|
|
+ "git.nspix.com/golang/kos/util/reflect"
|
|
|
+ reflectpkg "reflect"
|
|
|
+)
|
|
|
|
|
|
func Setter[T string | int | int64 | float64 | any](hacky any, variables map[string]T) (err error) {
|
|
|
for k, v := range variables {
|
|
@@ -11,6 +14,10 @@ func Setter[T string | int | int64 | float64 | any](hacky any, variables map[str
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func Assign(s reflectpkg.Value, v any) error {
|
|
|
+ return reflect.Assign(s, v)
|
|
|
+}
|
|
|
+
|
|
|
func Set(hacky any, field string, value any) (err error) {
|
|
|
return reflect.Set(hacky, field, value)
|
|
|
}
|