From 4e072ebcec8478c6269e9237a7410c3fbcc77ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Wed, 19 Mar 2025 18:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E5=88=92=E5=B5=8C=E5=A5=97=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=BD=93=E7=94=9F=E6=88=90=E7=9A=84=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builder.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builder.go b/builder.go index d705cbf..ecf1859 100644 --- a/builder.go +++ b/builder.go @@ -1,7 +1,6 @@ package dynamicstruct import ( - "fmt" "reflect" "strings" ) @@ -106,7 +105,7 @@ func (b *builderImpl) AddField(name string, pkg string, typ any, tag string, ano return b } // TODO : 添加嵌套的结构体 - fmt.Println(fieldNameArr) + b.addNestedField(fieldNameArr, pkg, typ, tag, anonymous) return b } @@ -128,6 +127,10 @@ func (b *builderImpl) addNormalField(name string, pkg string, typ any, tag strin }) } +// addNestedField 添加嵌套字段 +func (b *builderImpl) addNestedField(nameArr []string, pkg string, typ any, tag string, anonymous bool) { +} + // RemoveField 根据名称移除结构体字段 func (b *builderImpl) RemoveField(name string) Builder { newFieldList := make([]*fieldConfigImpl, 0)