From dba99075d3a1229d8dc6762ba17e0d07a573c64f Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Thu, 27 Jun 2024 16:19:47 -0700 Subject: [PATCH] Clean up. --- clients/redshift/dialect/dialect.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clients/redshift/dialect/dialect.go b/clients/redshift/dialect/dialect.go index 86c186b72..afc9c4497 100644 --- a/clients/redshift/dialect/dialect.go +++ b/clients/redshift/dialect/dialect.go @@ -74,15 +74,14 @@ func (RedshiftDialect) KindForDataType(rawType string, stringPrecision string) ( } if strings.Contains(rawType, "character varying") { - var strPrecision *int precision, err := strconv.Atoi(stringPrecision) - if err == nil { - strPrecision = &precision + if err != nil { + return typing.Invalid, fmt.Errorf("failed to parse string precision: %q, err: %w", stringPrecision, err) } return typing.KindDetails{ Kind: typing.String.Kind, - OptionalStringPrecision: strPrecision, + OptionalStringPrecision: &precision, }, nil }