Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
Remove filepath.Rel code from gc helper. (#693)
Browse files Browse the repository at this point in the history
GoFiles in gb come in two kinds.

1. relative to pkg.Dir
2. absolute

In this case the work to absify then relify the path is a noop, which is
further proven by removing it.
  • Loading branch information
davecheney committed Feb 22, 2017
1 parent d94d4f1 commit d4ba64b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,6 @@ func BuildDependencies(targets map[string]*Action, pkg *Package) ([]*Action, err

func gc(pkg *Package, gofiles []string) error {
t0 := time.Now()
for i := range gofiles {
if filepath.IsAbs(gofiles[i]) {
// terrible hack for cgo files which come with an absolute path
continue
}
fullpath := filepath.Join(pkg.Dir, gofiles[i])
path, err := filepath.Rel(pkg.Dir, fullpath)
if err == nil {
gofiles[i] = path
} else {
gofiles[i] = fullpath
}
}
err := pkg.tc.Gc(pkg, gofiles)
pkg.Record("gc", time.Since(t0))
return err
Expand Down

0 comments on commit d4ba64b

Please sign in to comment.