From 33057368db9f8ddf7d336b9920f496468e2eeaad Mon Sep 17 00:00:00 2001 From: Jason Parraga Date: Thu, 27 Feb 2025 22:13:41 -0800 Subject: [PATCH] Cleanup Signed-off-by: Jason Parraga --- flytestdlib/cli/pflags/api/generator.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/flytestdlib/cli/pflags/api/generator.go b/flytestdlib/cli/pflags/api/generator.go index bea95691ff..7588ac8dcd 100644 --- a/flytestdlib/cli/pflags/api/generator.go +++ b/flytestdlib/cli/pflags/api/generator.go @@ -239,8 +239,7 @@ func discoverFieldsRecursive(ctx context.Context, workingDirPkg string, typ inte addField(typ, f) case *types.Alias: - // For type aliases/named types (e.g. `type Foo int`), they will show up as Named but their underlying type - // will be basic. + // For alias types, they will show up as Alias but their underlying type will be basic. if b, isBasic := t.Underlying().(*types.Basic); isBasic { f, err := buildBasicField(ctx, tag, b, defaultValueAccessor, fieldPath, variable, false, false, isPtr, bindDefaultVar, nil) if err != nil { @@ -294,10 +293,10 @@ func discoverFieldsRecursive(ctx context.Context, workingDirPkg string, typ inte testValue = `"1"` } - logger.Infof(ctx, "[%v] is of a Named type (struct) with default value [%v].", tag.Name, tag.DefaultValue) + logger.Infof(ctx, "[%v] is of an Alias type (struct) with default value [%v].", tag.Name, tag.DefaultValue) if jsonUnmarshaler { - logger.Infof(logger.WithIndent(ctx, indent), "Type is json unmarhslalable.") + logger.Infof(logger.WithIndent(ctx, indent), "Type is json unmarshallable.") addField(typ, FieldInfo{ Name: tag.Name, @@ -341,8 +340,7 @@ func discoverFieldsRecursive(ctx context.Context, workingDirPkg string, typ inte } } case *types.Named: - // For type aliases/named types (e.g. `type Foo int`), they will show up as Named but their underlying type - // will be basic. + // For named types, they will show up as Named but their underlying type will be basic. if _, isBasic := t.Underlying().(*types.Basic); isBasic { logger.Debugf(ctx, "type [%v] is a named basic type. Using buildNamedBasicField to generate it.", t.Obj().Name()) f, err := buildNamedBasicField(ctx, workingDirPkg, tag, t, defaultValueAccessor, fieldPath, variable, isPtr, bindDefaultVar) @@ -400,7 +398,7 @@ func discoverFieldsRecursive(ctx context.Context, workingDirPkg string, typ inte logger.Infof(ctx, "[%v] is of a Named type (struct) with default value [%v].", tag.Name, tag.DefaultValue) if jsonUnmarshaler { - logger.Infof(logger.WithIndent(ctx, indent), "Type is json unmarhslalable.") + logger.Infof(logger.WithIndent(ctx, indent), "Type is json unmarshallable.") addField(typ, FieldInfo{ Name: tag.Name,