From 7f1dd3ae4df08a8619311c95f3e4c91b96132efd Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 1 Nov 2018 22:04:02 -0400 Subject: [PATCH] test: minor simplification to run.go This is a little clearer, and we're about to need the .s file list in one more place, so this will cut down on duplication. Change-Id: I4da8bf03a0469fb97565b0841c40d505657b574e Reviewed-on: https://go-review.googlesource.com/c/146998 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- test/run.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test/run.go b/test/run.go index b6421d5e41..6a050b0049 100644 --- a/test/run.go +++ b/test/run.go @@ -796,14 +796,14 @@ func (t *test) run() { t.err = dirErr break } - var gos []os.FileInfo - var asms []os.FileInfo + var gos []string + var asms []string for _, file := range files { switch filepath.Ext(file.Name()) { case ".go": - gos = append(gos, file) + gos = append(gos, filepath.Join(longdir, file.Name())) case ".s": - asms = append(asms, file) + asms = append(asms, filepath.Join(longdir, file.Name())) } } @@ -812,9 +812,7 @@ func (t *test) run() { if len(asms) > 0 { cmd = append(cmd, "-asmhdr", "go_asm.h") } - for _, file := range gos { - cmd = append(cmd, filepath.Join(longdir, file.Name())) - } + cmd = append(cmd, gos...) _, err := runcmd(cmd...) if err != nil { t.err = err @@ -823,9 +821,7 @@ func (t *test) run() { objs = append(objs, "go.o") if len(asms) > 0 { cmd = []string{goTool(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} - for _, file := range asms { - cmd = append(cmd, filepath.Join(longdir, file.Name())) - } + cmd = append(cmd, asms...) _, err = runcmd(cmd...) if err != nil { t.err = err -- 2.50.0