From 9b13942ac128a43ed8e343aeb48593314e817272 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Fri, 11 Dec 2020 15:21:40 +0100 Subject: [PATCH] chore: utility functions Signed-off-by: Leonardo Di Donato --- utils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 utils.go diff --git a/utils.go b/utils.go new file mode 100644 index 0000000..5d2aedc --- /dev/null +++ b/utils.go @@ -0,0 +1,10 @@ +package main + +import ( + "reflect" + "unsafe" +) + +func getUnexportedValue(field reflect.Value) reflect.Value { + return reflect.NewAt(field.Type(), unsafe.Pointer(field.UnsafeAddr())).Elem() +} \ No newline at end of file