From 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Sat, 20 Sep 2025 09:35:50 +0200 Subject: docs: add comments for all functions --- util/reflect_util/reflect.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/reflect_util/reflect.go') diff --git a/util/reflect_util/reflect.go b/util/reflect_util/reflect.go index 1fdaec50..1f557e0d 100644 --- a/util/reflect_util/reflect.go +++ b/util/reflect_util/reflect.go @@ -1,7 +1,9 @@ +// Package reflect_util provides reflection utilities for working with struct fields and values. package reflect_util import "reflect" +// GetFields returns all struct fields of the given reflect.Type. func GetFields(t reflect.Type) []reflect.StructField { num := t.NumField() fields := make([]reflect.StructField, 0, num) @@ -11,6 +13,7 @@ func GetFields(t reflect.Type) []reflect.StructField { return fields } +// GetFieldValues returns all field values of the given reflect.Value. func GetFieldValues(v reflect.Value) []reflect.Value { num := v.NumField() fields := make([]reflect.Value, 0, num) -- cgit v1.2.3