OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "bufio" | 8 "bufio" |
9 "fmt" | 9 "fmt" |
10 "go/ast" | 10 "go/ast" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 command = "bash" | 312 command = "bash" |
313 argv = []string{"bash", "-c", cmd} | 313 argv = []string{"bash", "-c", cmd} |
314 } | 314 } |
315 var err error | 315 var err error |
316 argv[0], err = exec.LookPath(argv[0]) | 316 argv[0], err = exec.LookPath(argv[0]) |
317 if err != nil { | 317 if err != nil { |
318 Fatalf("can't find %s: %s", command, err) | 318 Fatalf("can't find %s: %s", command, err) |
319 } | 319 } |
320 procAttr := &os.ProcAttr{ | 320 procAttr := &os.ProcAttr{ |
321 Env: env, | 321 Env: env, |
322 » » Files: []*os.File{ | 322 » » Files: { |
323 os.Stdin, | 323 os.Stdin, |
324 os.Stdout, | 324 os.Stdout, |
325 os.Stderr, | 325 os.Stderr, |
326 }, | 326 }, |
327 } | 327 } |
328 var r, w *os.File | 328 var r, w *os.File |
329 if returnStdout { | 329 if returnStdout { |
330 r, w, err = os.Pipe() | 330 r, w, err = os.Pipe() |
331 if err != nil { | 331 if err != nil { |
332 Fatalf("can't create pipe: %s", err) | 332 Fatalf("can't create pipe: %s", err) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 if err != nil { | 465 if err != nil { |
466 return | 466 return |
467 } | 467 } |
468 } | 468 } |
469 return matchRe.MatchString(str), nil | 469 return matchRe.MatchString(str), nil |
470 } | 470 } |
471 | 471 |
472 func main() { | 472 func main() { |
473 testing.Main(matchString, tests, benchmarks, examples) | 473 testing.Main(matchString, tests, benchmarks, examples) |
474 }` | 474 }` |
OLD | NEW |