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

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

Issue 12651044: code review 12651044: cmd/go: cgo programs depend on syscall (Closed)
Left Patch Set: diff -r 9c3e08a81548 https://code.google.com/p/go/ Created 11 years, 7 months ago
Right Patch Set: diff -r 70d8d820bfe6 https://code.google.com/p/go/ Created 11 years, 7 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/cmd/go/test.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 "bytes" 8 "bytes"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 buf.WriteString("\n") 318 buf.WriteString("\n")
319 buf.WriteString(e.Error()) 319 buf.WriteString(e.Error())
320 } 320 }
321 return errors.New(buf.String()) 321 return errors.New(buf.String())
322 } 322 }
323 return err 323 return err
324 } 324 }
325 325
326 var raceExclude = map[string]bool{ 326 var raceExclude = map[string]bool{
327 "runtime/race": true, 327 "runtime/race": true,
328 » "runtime/cgo": true, 328 » "runtime/cgo": true,
329 » "cmd/cgo": true, 329 » "cmd/cgo": true,
330 » "syscall": true, 330 » "syscall": true,
331 » "errors": true, 331 » "errors": true,
332 } 332 }
333 333
334 var cgoExclude = map[string]bool{ 334 var cgoExclude = map[string]bool{
335 "runtime/cgo": true, 335 "runtime/cgo": true,
336 } 336 }
337 337
338 var cgoSyscallExclude = map[string]bool{ 338 var cgoSyscallExclude = map[string]bool{
339 » "runtime/cgo": true, 339 » "runtime/cgo": true,
340 "runtime/race": true, 340 "runtime/race": true,
341 } 341 }
342 342
343 // load populates p using information from bp, err, which should 343 // load populates p using information from bp, err, which should
344 // be the result of calling build.Context.Import. 344 // be the result of calling build.Context.Import.
345 func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package { 345 func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package {
346 p.copyBuild(bp) 346 p.copyBuild(bp)
347 347
348 // The localPrefix is the path we interpret ./ imports relative to. 348 // The localPrefix is the path we interpret ./ imports relative to.
349 // Synthesized main packages sometimes override this. 349 // Synthesized main packages sometimes override this.
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 root = filepath.Clean(root) 855 root = filepath.Clean(root)
856 if !strings.HasSuffix(root, sep) { 856 if !strings.HasSuffix(root, sep) {
857 root += sep 857 root += sep
858 } 858 }
859 dir = filepath.Clean(dir) 859 dir = filepath.Clean(dir)
860 if !strings.HasPrefix(dir, root) { 860 if !strings.HasPrefix(dir, root) {
861 return "", false 861 return "", false
862 } 862 }
863 return filepath.ToSlash(dir[len(root):]), true 863 return filepath.ToSlash(dir[len(root):]), true
864 } 864 }
LEFTRIGHT

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