Commit 665a4166 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Russ Cox

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
parent 75cca052
...@@ -6,12 +6,19 @@ ...@@ -6,12 +6,19 @@
package os package os
import "syscall" import (
"runtime"
"syscall"
)
// Args hold the command-line arguments, starting with the program name. // Args hold the command-line arguments, starting with the program name.
var Args []string var Args []string
func init() { func init() {
if runtime.GOOS == "windows" {
// Initialized in exec_windows.go.
return
}
Args = runtime_args() Args = runtime_args()
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment