mirror of https://github.com/docker/cli.git
cli/command/container/stats.go:211:21: SA1015: using time.Tick leaks the underlying ticker, consider using it only in endless functions, tests and the main package, and use time.NewTicker here (staticcheck)
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
(cherry picked from commit 7da9360477
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
1ed4e67b34
commit
49ff9c82db
|
@ -208,7 +208,9 @@ func runStats(dockerCli command.Cli, opts *statsOptions) error {
|
|||
}
|
||||
|
||||
var err error
|
||||
for range time.Tick(500 * time.Millisecond) {
|
||||
ticker := time.NewTicker(500 * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
for range ticker.C {
|
||||
cleanScreen()
|
||||
ccstats := []StatsEntry{}
|
||||
cStats.mu.Lock()
|
||||
|
|
Loading…
Reference in New Issue