@@ -394,7 +394,7 @@ func (r Result) Structs() []GoStruct {
394394 s .Fields = append (s .Fields , GoField {
395395 Name : r .structName (column .Name ),
396396 Type : r .goType (column ),
397- Tags : map [string ]string {"json" : column .Name },
397+ Tags : map [string ]string {"json: " : column .Name },
398398 })
399399 }
400400 structs = append (structs , s )
@@ -429,9 +429,8 @@ func (r Result) goInnerType(columnType string, notNull bool) string {
429429 case "bigserial" , "pg_catalog.serial8" :
430430 if notNull {
431431 return "int64"
432- } else {
433- return "sql.NullInt64"
434432 }
433+ return "sql.NullInt64" // unnecessay else
435434
436435 case "smallserial" , "pg_catalog.serial2" :
437436 return "int16"
@@ -442,50 +441,44 @@ func (r Result) goInnerType(columnType string, notNull bool) string {
442441 case "bigint" , "pg_catalog.int8" :
443442 if notNull {
444443 return "int64"
445- } else {
446- return "sql.NullInt64"
447444 }
445+ return "sql.NullInt64" // unnecessary else
448446
449447 case "smallint" , "pg_catalog.int2" :
450448 return "int16"
451-
449+
452450 case "float" , "double precision" , "pg_catalog.float8" :
453451 if notNull {
454452 return "float64"
455- } else {
456- return "sql.NullFloat64"
457453 }
458-
454+ return "sql.NullFloat64" // unnecessary else
455+
459456 case "real" , "pg_catalog.float4" :
460457 if notNull {
461458 return "float32"
462- } else {
463- return "sql.NullFloat64" //IMPORTANT: Change to sql.NullFloat32 after updating the go.mod file
464- }
465-
459+ } // unnecessary else
460+ return "sql.NullFloat64" //IMPORTANT: Change to sql.NullFloat32 after updating the go.mod file
461+
466462 case "bool" , "pg_catalog.bool" :
467463 if notNull {
468464 return "bool"
469- } else {
470- return "sql.NullBool"
471465 }
466+ return "sql.NullBool" // unnecessary else
472467
473468 case "jsonb" :
474469 return "json.RawMessage"
475470
476471 case "pg_catalog.timestamp" , "pg_catalog.timestamptz" :
477472 if notNull {
478473 return "time.Time"
479- } else {
480- return "pq.NullTime"
481474 }
475+ return "pq.NullTime" // unnecessary else
482476
483477 case "text" , "pg_catalog.varchar" , "pg_catalog.bpchar" :
484478 if notNull {
485479 return "string"
486- } else {
487- return "sql.NullString"
488480 }
481+ return "sql.NullString" // unnecessary else
489482
490483 case "uuid" :
491484 return "uuid.UUID"
@@ -531,7 +524,7 @@ func (r Result) columnsToStruct(name string, columns []core.Column) *GoStruct {
531524 gs .Fields = append (gs .Fields , GoField {
532525 Name : fieldName ,
533526 Type : r .goType (c ),
534- Tags : map [string ]string {"json" : tagName },
527+ Tags : map [string ]string {"json: " : tagName },
535528 })
536529 seen [c .Name ] += 1
537530 }
@@ -915,7 +908,7 @@ func Generate(r *Result, global GenerateSettings, settings PackageSettings) (map
915908 tctx := tmplCtx {
916909 Settings : global ,
917910 EmitPreparedQueries : settings .EmitPreparedQueries ,
918- EmitJSONTags : settings .EmitTags ,
911+ EmitJSONTags : settings .EmitJSONTags ,
919912 Q : "`" ,
920913 Package : pkg ,
921914 GoQueries : r .GoQueries (),
0 commit comments