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

Delta Between Two Patch Sets: src/cmd/go/tool.go

Issue 5645093: code review 5645093: cmd/dist: cross-compiling fixes (Closed)
Left Patch Set: diff -r 4a0c77722a5e https://go.googlecode.com/hg/ Created 13 years, 1 month ago
Right Patch Set: diff -r aa8737f1a31b https://go.googlecode.com/hg/ Created 13 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/go/pkg.go ('k') | src/make.bash » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 "go/build" 9 "go/build"
10 "os" 10 "os"
(...skipping 13 matching lines...) Expand all
24 With no arguments it prints the list of known tools. 24 With no arguments it prints the list of known tools.
25 25
26 For more about each tool command, see 'go tool command -h'. 26 For more about each tool command, see 'go tool command -h'.
27 `, 27 `,
28 } 28 }
29 29
30 var ( 30 var (
31 toolGOOS = runtime.GOOS 31 toolGOOS = runtime.GOOS
32 toolGOARCH = runtime.GOARCH 32 toolGOARCH = runtime.GOARCH
33 toolIsWindows = toolGOOS == "windows" 33 toolIsWindows = toolGOOS == "windows"
34 » toolDir = filepath.Join(build.Path[0].Path, "bin", "tool", toolGOO S+"_"+toolGOARCH) 34 » toolDir = build.ToolDir
35 ) 35 )
36 36
37 const toolWindowsExtension = ".exe" 37 const toolWindowsExtension = ".exe"
38 38
39 func tool(name string) string { 39 func tool(name string) string {
40 p := filepath.Join(toolDir, name) 40 p := filepath.Join(toolDir, name)
41 if toolIsWindows { 41 if toolIsWindows {
42 p += toolWindowsExtension 42 p += toolWindowsExtension
43 } 43 }
44 return p 44 return p
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 for _, name := range names { 102 for _, name := range names {
103 // Unify presentation by going to lower case. 103 // Unify presentation by going to lower case.
104 name = strings.ToLower(name) 104 name = strings.ToLower(name)
105 // If it's windows, don't show the .exe suffix. 105 // If it's windows, don't show the .exe suffix.
106 if toolIsWindows && strings.HasSuffix(name, toolWindowsExtension ) { 106 if toolIsWindows && strings.HasSuffix(name, toolWindowsExtension ) {
107 name = name[:len(name)-len(toolWindowsExtension)] 107 name = name[:len(name)-len(toolWindowsExtension)]
108 } 108 }
109 fmt.Println(name) 109 fmt.Println(name)
110 } 110 }
111 } 111 }
LEFTRIGHT

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