From: Austin Clements Date: Fri, 2 Nov 2018 02:04:02 +0000 (-0400) Subject: test: minor simplification to run.go X-Git-Tag: go1.12beta1~393 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7f1dd3ae4df08a8619311c95f3e4c91b96132efd;p=gostls13.git 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 --- 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