fix: check if interval is empty string

This commit is contained in:
c9s 2022-07-08 14:47:36 +08:00
parent d86338d6e6
commit d7f83a45b3
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -609,7 +609,7 @@ type KLineCallBack func(k KLine)
func KLineWith(symbol string, interval Interval, callback KLineCallBack) KLineCallBack {
return func(k KLine) {
if k.Symbol != symbol || k.Interval != interval {
if k.Symbol != symbol || (k.Interval != "" && k.Interval != interval) {
return
}
callback(k)