You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So even we didn't render it, the lastShown time was set to time.Now() which is not so good for futher development. I think this variable shouldn't be set when the progress was render instead of called when the progress bar was just initialized.
We can use IsZero() to check whether the time is default value. And in my opinion, this change will make it possible for us to check whether the bar has been rendered before. If we could do that, we can add some goroutine for rendering the progress bar. Such as fix #141 , if we can check whether the progress bar start rendering, we can start a goroutine for it and re-render the progress bar according to the time interval.
And I think these arguments apply equally to lastShown and counterTime
I would like to ask your opinion on whether it needs to be changed and if it is ok, I'd like to pr for it.
The text was updated successfully, but these errors were encountered:
chengxilo
changed the title
I think the variable lastShown,startTime should not be set to time.Now()
I think the variable about time should not be set to time.Now()
Aug 29, 2024
I realized that we have this method
progressbar/progressbar.go
Lines 361 to 368 in 03fc4e9
it was called by
NewOption64
progressbar/progressbar.go
Lines 319 to 334 in 03fc4e9
So even we didn't render it, the lastShown time was set to time.Now() which is not so good for futher development. I think this variable shouldn't be set when the progress was render instead of called when the progress bar was just initialized.
We can use IsZero() to check whether the time is default value. And in my opinion, this change will make it possible for us to check whether the bar has been rendered before. If we could do that, we can add some goroutine for rendering the progress bar. Such as fix #141 , if we can check whether the progress bar start rendering, we can start a goroutine for it and re-render the progress bar according to the time interval.
And I think these arguments apply equally to lastShown and counterTime
I would like to ask your opinion on whether it needs to be changed and if it is ok, I'd like to pr for it.
The text was updated successfully, but these errors were encountered: