diff --git a/reflect/convert.go b/structcp/align.go similarity index 96% rename from reflect/convert.go rename to structcp/align.go index 2d1fffa..113dca9 100644 --- a/reflect/convert.go +++ b/structcp/align.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package reflect +package structcp import ( "reflect" @@ -27,7 +27,7 @@ const ( AlignToTag = "alignTo" ) -func Convert(target any, source any) { +func Align(target any, source any) { sourceValueOf := reflect.ValueOf(source) targetValueOf := reflect.ValueOf(target).Elem() diff --git a/reflect/convert_test.go b/structcp/align_test.go similarity index 98% rename from reflect/convert_test.go rename to structcp/align_test.go index cfd5022..dea6390 100644 --- a/reflect/convert_test.go +++ b/structcp/align_test.go @@ -15,7 +15,7 @@ * limitations under the License. */ -package reflect +package structcp import ( "reflect" @@ -74,7 +74,7 @@ func Test(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { logging.Logger.Infof("case name %s", test.name) - Convert(&test.target, test.source) + Align(&test.target, test.source) if test.align { sourceValueOf := reflect.ValueOf(test.source) targetValueOf := reflect.ValueOf(&test.target).Elem()