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>
This commit is contained in:
Silvin Lubecki 2019-04-02 11:11:36 +02:00 committed by Sebastiaan van Stijn
parent 8018a850cb
commit 7da9360477
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 3 additions and 1 deletions

View File

@ -208,7 +208,9 @@ func runStats(dockerCli command.Cli, opts *statsOptions) error {
} }
var err 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() cleanScreen()
ccstats := []StatsEntry{} ccstats := []StatsEntry{}
cStats.mu.Lock() cStats.mu.Lock()