From 5e9d773da5eb95394402232aec504c2d37aeb17e Mon Sep 17 00:00:00 2001 From: Gordon Bleux <33967640+UiP9AV6Y@users.noreply.github.com> Date: Thu, 8 Feb 2024 21:26:49 +0100 Subject: [PATCH] tools: add missing lazyReflect implementation --- tools/cmd/buildinfo/app/reflect.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tools/cmd/buildinfo/app/reflect.go diff --git a/tools/cmd/buildinfo/app/reflect.go b/tools/cmd/buildinfo/app/reflect.go new file mode 100644 index 0000000..81dfc61 --- /dev/null +++ b/tools/cmd/buildinfo/app/reflect.go @@ -0,0 +1,17 @@ +package app + +import ( + "reflect" + "strings" +) + +type lazyReflect struct { + v interface{} +} + +func (r *lazyReflect) String() string { + v := reflect.TypeOf(r.v).String() + p := strings.Split(v, ".") + + return strings.ToLower(p[len(p)-1]) +}