Improvements

This commit is contained in:
Alex Yatskov 2015-10-31 13:40:16 +09:00
parent 769b3073af
commit ef1d7d3621

View File

@ -24,7 +24,6 @@ package goldsmith
import ( import (
"io/ioutil" "io/ioutil"
"log"
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
@ -72,7 +71,7 @@ func (gs *goldsmith) scan(srcDir string) error {
return nil return nil
} }
func (gs *goldsmith) stage() stage { func (gs *goldsmith) makeStage() stage {
s := stage{ s := stage{
input: gs.stages[len(gs.stages)-1].output, input: gs.stages[len(gs.stages)-1].output,
output: make(chan File), output: make(chan File),
@ -87,7 +86,7 @@ func (gs *goldsmith) NewFile(relPath string) File {
} }
func (gs *goldsmith) Apply(p Processor) Goldsmith { func (gs *goldsmith) Apply(p Processor) Goldsmith {
s := gs.stage() s := gs.makeStage()
go p.Process(gs, s.input, s.output) go p.Process(gs, s.input, s.output)
return gs return gs
} }
@ -97,8 +96,6 @@ func (gs *goldsmith) Complete(dstDir string) []File {
var files []File var files []File
for file := range s.output { for file := range s.output {
log.Print(file)
data := file.Data() data := file.Data()
if data == nil { if data == nil {
continue continue