@@ -39,25 +39,25 @@ func (c *QueryResultCol) String(ctx context.Context) string {
3939 if valueExtracted == nil {
4040 return ""
4141 }
42- switch valueExtracted .(type ) {
42+ switch v := valueExtracted .(type ) {
4343 case string :
44- processed , err := json .Marshal (valueExtracted )
44+ processed , err := json .Marshal (v )
4545 if err != nil {
46- logger .ErrorWithCtx (ctx ).Err (err ).Msgf ("failed to marshal value %v" , valueExtracted )
46+ logger .ErrorWithCtx (ctx ).Err (err ).Msgf ("failed to marshal value %v" , v )
4747 }
4848 return fmt .Sprintf (`"%s": %s` , c .ColName , string (processed ))
4949 case time.Time :
5050 // Format timestamp with consistent microsecond precision
51- formattedTime := valueExtracted .(time. Time ) .Format ("2006-01-02 15:04:05.000000 -0700 MST" )
51+ formattedTime := v .Format ("2006-01-02 15:04:05.000000 -0700 MST" )
5252 return fmt .Sprintf (`"%s": "%s"` , c .ColName , formattedTime )
5353 case int , int64 , float64 , uint64 , bool :
54- return fmt .Sprintf (`"%s": %v` , c .ColName , valueExtracted )
54+ return fmt .Sprintf (`"%s": %v` , c .ColName , v )
5555 default :
5656 // Probably good to only use marshaller when necessary, so for arrays/maps,
5757 // and try to handle simple cases without it
58- marshalled , err := json .Marshal (valueExtracted )
58+ marshalled , err := json .Marshal (v )
5959 if err != nil {
60- logger .ErrorWithCtx (ctx ).Err (err ).Msgf ("failed to marshal value %v" , valueExtracted )
60+ logger .ErrorWithCtx (ctx ).Err (err ).Msgf ("failed to marshal value %v" , v )
6161 }
6262 return fmt .Sprintf (`"%s": %v` , c .ColName , string (marshalled ))
6363 }
0 commit comments