Merge pull request #808 from c9s/fix/kline-with-filtering

This commit is contained in:
Yo-An Lin 2022-07-08 21:02:28 +08:00 committed by GitHub
commit e6d9a8a84a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)