diff --git a/pkg/toolkit/types.go b/pkg/toolkit/types.go index 2a41e9e6..f67ae858 100644 --- a/pkg/toolkit/types.go +++ b/pkg/toolkit/types.go @@ -130,14 +130,16 @@ func TryRegisterCustomTypes(typeMap *pgtype.Map, types []*Type, silent bool) { if t.Kind == 'd' { if t.BaseType != 0 { baseType, ok := typeMap.TypeForOID(uint32(t.BaseType)) - if !ok && !silent { - log.Warn(). - Str("Context", "CustomTypeRegistering"). - Str("Schema", t.Schema). - Str("Name", t.Name). - Int("Oid", int(t.Oid)). - Str("Kind", fmt.Sprintf("%c", t.Kind)). - Msg("unable to register domain type") + if !ok { + if !silent { + log.Warn(). + Str("Context", "CustomTypeRegistering"). + Str("Schema", t.Schema). + Str("Name", t.Name). + Int("Oid", int(t.Oid)). + Str("Kind", fmt.Sprintf("%c", t.Kind)). + Msg("unable to register domain type") + } continue } typeMap.RegisterType(&pgtype.Type{ @@ -146,14 +148,17 @@ func TryRegisterCustomTypes(typeMap *pgtype.Map, types []*Type, silent bool) { Codec: baseType.Codec, }) arrayType, ok := typeMap.TypeForName(fmt.Sprintf("_%s", baseType.Name)) - if !ok && !silent { - log.Warn(). - Str("Context", "CustomTypeRegistering"). - Str("Schema", t.Schema). - Str("Name", t.Name). - Int("Oid", int(t.Oid)). - Msg("cannot register array type for custom type") + if !ok { + if !silent { + log.Warn(). + Str("Context", "CustomTypeRegistering"). + Str("Schema", t.Schema). + Str("Name", t.Name). + Int("Oid", int(t.Oid)). + Msg("cannot register array type for custom type") + } continue + } arrayTypeName := fmt.Sprintf("_%s", t.Name) typeMap.RegisterType(&pgtype.Type{