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

Commit

Permalink
resolve nits
Browse files Browse the repository at this point in the history
Signed-off-by: Ibrahim AshShohail <ibra.sho@gmail.com>
  • Loading branch information
ibrasho committed Dec 7, 2017
1 parent e113a9b commit fb9ac8c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 1 addition & 3 deletions gps/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ type fsLink struct {
// deriveFilesystemState returns a filesystemState based on the state of
// the filesystem on root.
func deriveFilesystemState(root string) (filesystemState, error) {
fs := filesystemState{
root: root,
}
fs := filesystemState{root: root}

err := filepath.Walk(fs.root, func(path string, info os.FileInfo, err error) error {
if err != nil {
Expand Down
6 changes: 2 additions & 4 deletions gps/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func DefaultRootPruneOptions() RootPruneOptions {
// PruneOptionsFor returns the prune options for the passed project root.
//
// It will return the root prune options if the project does not have specific
// options or if it does not exists in the manifest.
// options or if it does not exist in the manifest.
func (o *RootPruneOptions) PruneOptionsFor(pr ProjectRoot) PruneOptions {
if po, ok := o.ProjectOptions[pr]; ok {
return po
Expand Down Expand Up @@ -203,13 +203,12 @@ func collectUnusedPackagesFiles(fsState filesystemState, unusedPackages map[stri
//
// Files matching licenseFilePrefixes and legalFileSubstrings are not pruned.
func pruneNonGoFiles(fsState filesystemState) error {
// TODO(ibrasho) detemine a sane capacity
toDelete := make([]string, 0, len(fsState.files)/4)

for _, path := range fsState.files {
ext := fileExt(path)

// Refer to: https://sourcegraph.com/github.com/golang/go/-/blob/src/go/build/build.go#L750
// Refer to: https://github.com/golang/go/blob/release-branch.go1.9/src/go/build/build.go#L750
switch ext {
case ".go":
continue
Expand Down Expand Up @@ -274,7 +273,6 @@ func isPreservedFile(name string) bool {

// pruneGoTestFiles deletes all Go test files (*_test.go) in fsState.
func pruneGoTestFiles(fsState filesystemState) error {
// TODO(ibrasho) detemine a sane capacity
toDelete := make([]string, 0, len(fsState.files)/2)

for _, path := range fsState.files {
Expand Down
1 change: 0 additions & 1 deletion txn_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"testing"

"github.com/golang/dep/gps"

"github.com/golang/dep/internal/test"
"github.com/pkg/errors"
)
Expand Down

0 comments on commit fb9ac8c

Please sign in to comment.