From b7973b75f16f27f7ce4bd064ef31717119a9c641 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Fri, 18 Jan 2019 12:47:32 -0600 Subject: [PATCH] get rid of init --- executor_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/executor_test.go b/executor_test.go index 46d73220a..910ab14ba 100644 --- a/executor_test.go +++ b/executor_test.go @@ -36,17 +36,19 @@ import ( ) var ( - TempDir *string + TempDir = getTempDirString() ) -func init() { // nolint: gochecknoinits +func getTempDirString() (td *string) { tdflag := flag.Lookup("temp-dir") + if tdflag == nil { - TempDir = flag.String("temp-dir", "", "Directory in which to place temporary data (e.g. for benchmarking). Useful if you are trying to benchmark different storage configurations.") + td = flag.String("temp-dir", "", "Directory in which to place temporary data (e.g. for benchmarking). Useful if you are trying to benchmark different storage configurations.") } else { s := tdflag.Value.String() - TempDir = &s + td = &s } + return td } // Ensure a row query can be executed.