@@ -289,27 +289,29 @@ func doTest(cmdline []string) {
289
289
build .MustRun (goTool ("vet" , packages ... ))
290
290
}
291
291
if * misspell {
292
- // The spell checker doesn't work on packages, gather all .go files for it
293
- sources := []string {}
292
+ // Ensure the spellchecker is available
293
+ build .MustRun (goTool ("get" , "github.com/client9/misspell/cmd/misspell" ))
294
+
295
+ // Windows (AppVeyor) chokes on long argument lists, check packages individualy
294
296
for _ , pkg := range packages {
295
- // Gather all the source files of the package
297
+ // The spell checker doesn't work on packages, gather all .go files for it
296
298
out , err := goTool ("list" , "-f" , "{{.Dir}}{{range .GoFiles}}\n {{.}}{{end}}{{range .CgoFiles}}\n {{.}}{{end}}{{range .TestGoFiles}}\n {{.}}{{end}}" , pkg ).CombinedOutput ()
297
299
if err != nil {
298
300
log .Fatalf ("source file listing failed: %v\n %s" , err , string (out ))
299
301
}
300
302
// Retrieve the folder and assemble the source list
301
303
lines := strings .Split (string (out ), "\n " )
302
-
303
304
root := lines [0 ]
305
+
306
+ sources := make ([]string , 0 , len (lines )- 1 )
304
307
for _ , line := range lines [1 :] {
305
308
if line = strings .TrimSpace (line ); line != "" {
306
309
sources = append (sources , filepath .Join (root , line ))
307
310
}
308
311
}
312
+ // Run the spell checker for this particular package
313
+ build .MustRunCommand (filepath .Join (GOBIN , "misspell" ), append ([]string {"-error" }, sources ... )... )
309
314
}
310
- // Download the spell checker tool and run on all source files
311
- build .MustRun (goTool ("get" , "github.com/client9/misspell/cmd/misspell" ))
312
- build .MustRunCommand (filepath .Join (GOBIN , "misspell" ), append ([]string {"-error" }, sources ... )... )
313
315
}
314
316
// Run the actual tests.
315
317
gotest := goTool ("test" )
0 commit comments