aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2014-09-24 18:50:54 -0400
committerRuss Cox <rsc@golang.org>2014-09-24 18:50:54 -0400
commit665a4166650d088c067130eb41f8f95efb9c12ed (patch)
treecc61b52212f36a31fb4904365cd43b7660ad43a1 /src
parent75cca0526dc00ffeacc2aecfa6a0263a5f276e8b (diff)
downloadgo-665a4166650d088c067130eb41f8f95efb9c12ed.tar.xz
os: fix Args setup on Windows
Should fix the Windows build. Untested. on Windows, args are made by src/os/exec_windows.go, not package runtime. runtimeĀ·goargs has if(Windows) return; The two init funcs in pkg os were conflicting, with the second overwriting Args back to an empty slice. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/143540044
Diffstat (limited to 'src')
-rw-r--r--src/os/proc.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/os/proc.go b/src/os/proc.go
index b63c85ad90..774f09900e 100644
--- a/src/os/proc.go
+++ b/src/os/proc.go
@@ -6,12 +6,19 @@
package os
-import "syscall"
+import (
+ "runtime"
+ "syscall"
+)
// Args hold the command-line arguments, starting with the program name.
var Args []string
func init() {
+ if runtime.GOOS == "windows" {
+ // Initialized in exec_windows.go.
+ return
+ }
Args = runtime_args()
}