diff --git a/loader.go b/loader.go index 5c21256..dea632e 100644 --- a/loader.go +++ b/loader.go @@ -72,12 +72,3 @@ func loadDiff[T any](old T, newT T) error { return nil } - -func isPointerToStruct[T any](t T) bool { - rv := reflect.ValueOf(t) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return false - } - - return rv.Elem().Kind() == reflect.Struct -} diff --git a/pointer.go b/pointer.go deleted file mode 100644 index 9323588..0000000 --- a/pointer.go +++ /dev/null @@ -1,6 +0,0 @@ -package patcher - -// ptr returns a pointer to the value passed in. -func ptr[T any](v T) *T { - return &v -} diff --git a/utils.go b/utils.go new file mode 100644 index 0000000..3814c8c --- /dev/null +++ b/utils.go @@ -0,0 +1,17 @@ +package patcher + +import "reflect" + +// ptr returns a pointer to the value passed in. +func ptr[T any](v T) *T { + return &v +} + +func isPointerToStruct[T any](t T) bool { + rv := reflect.ValueOf(t) + if rv.Kind() != reflect.Ptr || rv.IsNil() { + return false + } + + return rv.Elem().Kind() == reflect.Struct +}