Commit 6a426169 authored by Shenghou Ma's avatar Shenghou Ma

cmd/go: always provide .exe suffix on windows

        Fixes #3190.

R=rsc, tjyang2001, rsc
CC=golang-dev
https://golang.org/cl/5759056
parent c086bc1d
......@@ -168,9 +168,7 @@ func runBuild(cmd *Command, args []string) {
if len(pkgs) == 1 && pkgs[0].Name == "main" && *buildO == "" {
_, *buildO = path.Split(pkgs[0].ImportPath)
if goos == "windows" {
*buildO += ".exe"
}
*buildO += exeSuffix
}
if *buildO != "" {
......@@ -392,7 +390,7 @@ func goFilesPackage(gofiles []string) *Package {
if *buildO == "" {
if pkg.Name == "main" {
_, elem := filepath.Split(gofiles[0])
*buildO = elem[:len(elem)-len(".go")]
*buildO = elem[:len(elem)-len(".go")] + exeSuffix
} else {
*buildO = pkg.Name + ".a"
}
......
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