From c62b07a119f10c122735e61989aad2c903661bf2 Mon Sep 17 00:00:00 2001 From: what Date: Tue, 16 Dec 2025 16:18:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=AE=80=E5=8C=96=20normalizeInput?= =?UTF-8?q?Value=20=E7=B1=BB=E5=9E=8B=E5=8C=B9=E9=85=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于 R 接口继承 valuex.Accessor,无需单独处理 R 类型 使用 valuex.Accessor 统一处理即可,减少冗余代码 --- reflux.go | 4 ---- util.go | 3 --- 2 files changed, 7 deletions(-) diff --git a/reflux.go b/reflux.go index f348a08..b587443 100644 --- a/reflux.go +++ b/reflux.go @@ -48,10 +48,6 @@ type R interface { // Keys 返回当前映射或结构体的所有键名 Keys() []string - - // Raw 返回底层的 reflect.Value - // 用于需要直接操作反射值的场景 - Raw() reflect.Value } // New 创建一个新的 R 实例 diff --git a/util.go b/util.go index 6aea61e..8797a50 100644 --- a/util.go +++ b/util.go @@ -385,9 +385,6 @@ func normalizeInputValue(v any) (reflect.Value, bool, error) { var isPtr bool switch vv := v.(type) { - case R: - isPtr = true - rv = vv.Raw() case valuex.Accessor: isPtr = true rv = vv.Raw()