@@ -335,39 +335,39 @@ func parseSecQuote(quote string) *SecurityQuote {
335
335
newQuote = strings .TrimSuffix (newQuote , "\" " )
336
336
items := strings .Split (newQuote , "," )
337
337
res := new (SecurityQuote )
338
- res .Name = items [0 ]
338
+ res .Name = strings . TrimSpace ( items [0 ])
339
339
slog .Debug ("parseSecQuote" , "quote string" , quote , "items" , items )
340
340
var err error
341
- res .Current , err = strconv .ParseFloat (items [3 ], 64 )
341
+ res .Current , err = strconv .ParseFloat (strings . TrimSpace ( items [3 ]) , 64 )
342
342
if err != nil {
343
343
slog .Error (err .Error ())
344
344
}
345
- res .Open , err = strconv .ParseFloat (items [1 ], 64 )
345
+ res .Open , err = strconv .ParseFloat (strings . TrimSpace ( items [1 ]) , 64 )
346
346
if err != nil {
347
347
slog .Error (err .Error ())
348
348
}
349
- res .YClose , err = strconv .ParseFloat (items [2 ], 64 )
349
+ res .YClose , err = strconv .ParseFloat (strings . TrimSpace ( items [2 ]) , 64 )
350
350
if err != nil {
351
351
slog .Error (err .Error ())
352
352
}
353
- res .High , err = strconv .ParseFloat (items [4 ], 64 )
353
+ res .High , err = strconv .ParseFloat (strings . TrimSpace ( items [4 ]) , 64 )
354
354
if err != nil {
355
355
slog .Error (err .Error ())
356
356
}
357
- res .Low , err = strconv .ParseFloat (items [5 ], 64 )
357
+ res .Low , err = strconv .ParseFloat (strings . TrimSpace ( items [5 ]) , 64 )
358
358
if err != nil {
359
359
slog .Error (err .Error ())
360
360
}
361
- res .Volume , err = strconv .ParseFloat (items [9 ], 64 )
361
+ res .Volume , err = strconv .ParseFloat (strings . TrimSpace ( items [9 ]) , 64 )
362
362
if err != nil {
363
363
slog .Error (err .Error ())
364
364
}
365
- res .TurnOver , err = strconv .ParseInt (items [8 ], 10 , 64 )
365
+ res .TurnOver , err = strconv .ParseInt (strings . TrimSpace ( items [8 ]) , 10 , 64 )
366
366
if err != nil {
367
367
slog .Error (err .Error ())
368
368
}
369
- res .TradeDate = items [30 ]
370
- res .Time = items [31 ]
369
+ res .TradeDate = strings . TrimSpace ( items [30 ])
370
+ res .Time = strings . TrimSpace ( items [31 ])
371
371
372
372
return res
373
373
}
0 commit comments