Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(246)

Side by Side Diff: src/cmd/go/run.go

Issue 65890043: code review 65890043: cmd/go: skip writing dwarf debug info for ephemeral binaries (Closed)
Patch Set: diff -r 1b09c63ca02a https://code.google.com/p/go/ Created 10 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/cmd/go/pkg.go ('k') | src/cmd/go/test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "fmt" 8 "fmt"
9 "os" 9 "os"
10 "os/exec" 10 "os/exec"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 if strings.HasSuffix(file, "_test.go") { 51 if strings.HasSuffix(file, "_test.go") {
52 // goFilesPackage is going to assign this to TestGoFiles . 52 // goFilesPackage is going to assign this to TestGoFiles .
53 // Reject since it won't be part of the build. 53 // Reject since it won't be part of the build.
54 fatalf("go run: cannot run *_test.go files (%s)", file) 54 fatalf("go run: cannot run *_test.go files (%s)", file)
55 } 55 }
56 } 56 }
57 p := goFilesPackage(files) 57 p := goFilesPackage(files)
58 if p.Error != nil { 58 if p.Error != nil {
59 fatalf("%s", p.Error) 59 fatalf("%s", p.Error)
60 } 60 }
61 p.omitDWARF = true
61 for _, err := range p.DepsErrors { 62 for _, err := range p.DepsErrors {
62 errorf("%s", err) 63 errorf("%s", err)
63 } 64 }
64 exitIfErrors() 65 exitIfErrors()
65 if p.Name != "main" { 66 if p.Name != "main" {
66 fatalf("go run: cannot run non-main package") 67 fatalf("go run: cannot run non-main package")
67 } 68 }
68 p.target = "" // must build - not up to date 69 p.target = "" // must build - not up to date
69 var src string 70 var src string
70 if len(p.GoFiles) > 0 { 71 if len(p.GoFiles) > 0 {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 cmdline := stringList(cmdargs...) 106 cmdline := stringList(cmdargs...)
106 cmd := exec.Command(cmdline[0], cmdline[1:]...) 107 cmd := exec.Command(cmdline[0], cmdline[1:]...)
107 cmd.Stdin = os.Stdin 108 cmd.Stdin = os.Stdin
108 cmd.Stdout = os.Stdout 109 cmd.Stdout = os.Stdout
109 cmd.Stderr = os.Stderr 110 cmd.Stderr = os.Stderr
110 startSigHandlers() 111 startSigHandlers()
111 if err := cmd.Run(); err != nil { 112 if err := cmd.Run(); err != nil {
112 errorf("%v", err) 113 errorf("%v", err)
113 } 114 }
114 } 115 }
OLDNEW
« no previous file with comments | « src/cmd/go/pkg.go ('k') | src/cmd/go/test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b