don't output Docker performance issues when user wants JSON

pull/13135/head
Steven Powell 2021-12-09 14:38:18 -08:00
parent 90300a4c52
commit 8d7a636bfe
3 changed files with 3 additions and 1 deletions

View File

@ -135,7 +135,7 @@ func runCmd(cmd *exec.Cmd, warnSlow ...bool) (*RunResult, error) {
start := time.Now()
err := cmd.Run()
elapsed := time.Since(start)
if warn {
if warn && !out.JSON {
if elapsed > warnTime {
warnLock.Lock()
_, ok := alreadyWarnedCmds[rr.Command()]

View File

@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
/*

View File

@ -1,3 +1,4 @@
//go:build windows
// +build windows
/*