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

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

Issue 40600043: code review 40600043: cmd/nm: reimplement in Go (Closed)
Left Patch Set: Created 11 years, 3 months ago
Right Patch Set: diff -r 5130190e81b5 https://code.google.com/p/go/ Created 11 years, 3 months 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/dist/build.c ('k') | src/cmd/nm/Makefile » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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 "bytes" 8 "bytes"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 toRoot targetDir = iota // to bin dir inside package root (default) 300 toRoot targetDir = iota // to bin dir inside package root (default)
301 toTool // GOROOT/pkg/tool 301 toTool // GOROOT/pkg/tool
302 toBin // GOROOT/bin 302 toBin // GOROOT/bin
303 ) 303 )
304 304
305 // goTools is a map of Go program import path to install target directory. 305 // goTools is a map of Go program import path to install target directory.
306 var goTools = map[string]targetDir{ 306 var goTools = map[string]targetDir{
307 "cmd/api": toTool, 307 "cmd/api": toTool,
308 "cmd/cgo": toTool, 308 "cmd/cgo": toTool,
309 "cmd/fix": toTool, 309 "cmd/fix": toTool,
310 "cmd/nm": toTool,
310 "cmd/yacc": toTool, 311 "cmd/yacc": toTool,
311 "code.google.com/p/go.tools/cmd/cover": toTool, 312 "code.google.com/p/go.tools/cmd/cover": toTool,
312 "code.google.com/p/go.tools/cmd/godoc": toBin, 313 "code.google.com/p/go.tools/cmd/godoc": toBin,
313 "code.google.com/p/go.tools/cmd/vet": toTool, 314 "code.google.com/p/go.tools/cmd/vet": toTool,
314 } 315 }
315 316
316 // expandScanner expands a scanner.List error into all the errors in the list. 317 // expandScanner expands a scanner.List error into all the errors in the list.
317 // The default Error method only shows the first error. 318 // The default Error method only shows the first error.
318 func expandScanner(err error) error { 319 func expandScanner(err error) error {
319 // Look for parser errors. 320 // Look for parser errors.
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 root = filepath.Clean(root) 852 root = filepath.Clean(root)
852 if !strings.HasSuffix(root, sep) { 853 if !strings.HasSuffix(root, sep) {
853 root += sep 854 root += sep
854 } 855 }
855 dir = filepath.Clean(dir) 856 dir = filepath.Clean(dir)
856 if !strings.HasPrefix(dir, root) { 857 if !strings.HasPrefix(dir, root) {
857 return "", false 858 return "", false
858 } 859 }
859 return filepath.ToSlash(dir[len(root):]), true 860 return filepath.ToSlash(dir[len(root):]), true
860 } 861 }
LEFTRIGHT

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