From ab1f64a83e3b00ab6fe434df47d8e4d93861dcfc Mon Sep 17 00:00:00 2001 From: mojoma Date: Thu, 25 Nov 2021 21:58:38 +0800 Subject: [PATCH] remove unnecessary code --- os/gstructs/gstructs_type.go | 4 ---- protocol/goai/goai_path.go | 7 +------ 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/os/gstructs/gstructs_type.go b/os/gstructs/gstructs_type.go index b1ab79204..1d0caf39b 100644 --- a/os/gstructs/gstructs_type.go +++ b/os/gstructs/gstructs_type.go @@ -48,10 +48,6 @@ func StructType(object interface{}) (*Type, error) { } exitLoop: - for reflectKind == reflect.Ptr { - reflectValue = reflectValue.Elem() - reflectKind = reflectValue.Kind() - } if reflectKind != reflect.Struct { return nil, errors.New( fmt.Sprintf( diff --git a/protocol/goai/goai_path.go b/protocol/goai/goai_path.go index 9fd305a73..92fb81572 100644 --- a/protocol/goai/goai_path.go +++ b/protocol/goai/goai_path.go @@ -78,12 +78,7 @@ func (oai *OpenApiV3) addPath(in addPathInput) error { } else { outputObject = reflect.New(reflectType.Out(0)).Elem() } - for inputObject.Kind() == reflect.Ptr { - inputObject = inputObject.Elem() - } - for outputObject.Kind() == reflect.Ptr { - outputObject = outputObject.Elem() - } + var ( path = Path{} inputMetaMap = gmeta.Data(inputObject.Interface())