diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2014-09-24 18:50:54 -0400 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2014-09-24 18:50:54 -0400 |
commit | cf27229c88c4df2707372ae8c952177137086b44 (patch) | |
tree | 4af0aa6ea072a5b2cea11da330358ac3088946ed /src/os | |
parent | becb4f5ba637acbd9d157bb7884fad1fc57a4170 (diff) | |
download | go-cf27229c88c4df2707372ae8c952177137086b44.tar.gz |
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://codereview.appspot.com/143540044
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/os')
-rw-r--r-- | src/os/proc.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/os/proc.go b/src/os/proc.go index b63c85ad9..774f09900 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() } |