Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Feb 2, 2013
1 parent 5d71ff9 commit a72292b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion fileitem.go
Expand Up @@ -7,7 +7,6 @@ import (
type FileItem struct {
Name string
Path string // full path
// Size int64
}

func (p * FileItem) String() string {
Expand Down
8 changes: 2 additions & 6 deletions golocate/golocate.go
Expand Up @@ -6,14 +6,8 @@ import (
"flag"
"fmt"
"log"
// "bufio"
)

func visit(path string, f os.FileInfo, err error) error {
fmt.Printf("Visited: %s %d\n", path, f.Size() )
return nil
}

func main() {
var flagUpdate *bool = flag.Bool("update",false,"Update index")
var flagVerbose *bool = flag.Bool("v",false,"Verbose output")
Expand Down Expand Up @@ -43,7 +37,9 @@ func main() {
db.PrepareStructure()

if *flagIndex {
log.Println("Building default ignore list...")
db.IgnoreString(".DS_Store")
db.IgnoreString(".o")
db.IgnoreString(".git")
db.IgnoreString(".svn")
db.IgnoreString(".hg")
Expand Down
2 changes: 0 additions & 2 deletions indexdb.go
Expand Up @@ -115,7 +115,6 @@ func (p * IndexDb) MakeIndex() {
for fileitem = <-filepipe ; fileitem != nil ; {
p.FileItems = append(p.FileItems,*fileitem)
if p.verbose {
// fmt.Printf(" Add\t%s %s\n", fileitem.Path, PrettySize( int(fileitem.Size) ) )
fmt.Printf(" Add\t%s\n", fileitem.Path)
}
fileitem = <-filepipe
Expand Down Expand Up @@ -158,7 +157,6 @@ func (p * IndexDb) TraverseDirectory(root string, ch chan<- *FileItem) (error) {
return nil
}

// var fileitem FileItem = FileItem{ Size: fi.Size(), Name: fi.Name(), Path: path }
var fileitem FileItem = FileItem{ Name: fi.Name(), Path: path }
ch <- &fileitem
return nil
Expand Down

0 comments on commit a72292b

Please sign in to comment.