Skip to content

Commit

Permalink
[AB#1669514] Linter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ChronosMasterOfAllTime committed Dec 9, 2024
1 parent e89206f commit 3830f56
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ func isInterfaceArrayBinding(t interface{}) bool {
}
}

func isJsonFormatType(tsmode snowflakeType) bool {
func isJSONFormatType(tsmode snowflakeType) bool {
return tsmode == objectType || tsmode == arrayType || tsmode == sliceType
}

// goTypeToSnowflake translates Go data type to Snowflake data type.
func goTypeToSnowflake(v driver.Value, tsmode snowflakeType) snowflakeType {
if isJsonFormatType(tsmode) {
if isJSONFormatType(tsmode) {
return tsmode
}
if v == nil {
Expand Down Expand Up @@ -243,9 +243,9 @@ func snowflakeTypeToGoForMaps[K comparable](ctx context.Context, valueMetadata f
// in queries.
func valueToString(v driver.Value, tsmode snowflakeType, params map[string]*string) (bindingValue, error) {
logger.Debugf("TYPE: %v, %v", reflect.TypeOf(v), reflect.ValueOf(v))
isJsonFormat := isJsonFormatType(tsmode)
isJSONFormat := isJSONFormatType(tsmode)
if v == nil {
if isJsonFormat {
if isJSONFormat {
return bindingValue{nil, jsonFormatStr, nil}, nil
}
return bindingValue{nil, "", nil}, nil
Expand All @@ -256,7 +256,7 @@ func valueToString(v driver.Value, tsmode snowflakeType, params map[string]*stri
if value, err := valuer.Value(); err == nil && value != nil {
// if the output value is a valid string, return that
if strVal, ok := value.(string); ok {
if isJsonFormat {
if isJSONFormat {
return bindingValue{&strVal, jsonFormatStr, nil}, nil
}
return bindingValue{&strVal, "", nil}, nil
Expand All @@ -276,7 +276,7 @@ func valueToString(v driver.Value, tsmode snowflakeType, params map[string]*stri
return bindingValue{&s, "", nil}, nil
case reflect.String:
s := v1.String()
if isJsonFormat {
if isJSONFormat {
return bindingValue{&s, jsonFormatStr, nil}, nil
}
return bindingValue{&s, "", nil}, nil
Expand Down Expand Up @@ -821,7 +821,7 @@ func structValueToString(v driver.Value, tsmode snowflakeType, params map[string
return bindingValue{&s, "", nil}, nil
case sql.NullString:
fmt := ""
if isJsonFormatType(tsmode) {
if isJSONFormatType(tsmode) {
fmt = jsonFormatStr
}
if !typedVal.Valid {
Expand Down

0 comments on commit 3830f56

Please sign in to comment.