cmd: use os.MkdirTemp instead of ioutil.TempDir (#10320)

Signed-off-by: ianwoolf <btw515wolf2@gmail.com>
This commit is contained in:
ian woolf 2022-03-08 21:08:53 +08:00 committed by GitHub
parent a9e2ffb717
commit 025528a5d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,6 @@ import (
"context" "context"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"math" "math"
"os" "os"
"path/filepath" "path/filepath"
@ -70,7 +69,7 @@ func benchmarkWrite(outPath, samplesFile string, numMetrics, numScrapes int) err
logger: log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)), logger: log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)),
} }
if b.outPath == "" { if b.outPath == "" {
dir, err := ioutil.TempDir("", "tsdb_bench") dir, err := os.MkdirTemp("", "tsdb_bench")
if err != nil { if err != nil {
return err return err
} }