Skip to content

Commit

Permalink
update scrape
Browse files Browse the repository at this point in the history
  • Loading branch information
godcong committed Mar 16, 2021
1 parent 61cdc90 commit da52a53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type IScrape interface {
Find(name string) (e error)
Clear()
Range(rangeFunc RangeFunc) error
OutputCallback(f func(key string, content Content) *OutputInfo) []*OutputInfo
OutputCallback(f func(key string, content Content) *OutputInfo) []OutputInfo
Output() error
}

Expand Down Expand Up @@ -161,8 +161,8 @@ func (impl *scrapeImpl) Output() error {
})
}

func (impl scrapeImpl) OutputCallback(f func(key string, content Content) *OutputInfo) []*OutputInfo {
var result []*OutputInfo
func (impl scrapeImpl) OutputCallback(f func(key string, content Content) *OutputInfo) []OutputInfo {
var result []OutputInfo
impl.Range(func(key string, content Content) error {
option := f(key, content)
if option == nil {
Expand All @@ -173,7 +173,7 @@ func (impl scrapeImpl) OutputCallback(f func(key string, content Content) *Outpu
}
err := copyFileWithInfo(impl.Cache(), content, option)
if err == nil && !option.Skip {
result = append(result, option)
result = append(result, *option)
}
return err
})
Expand Down

0 comments on commit da52a53

Please sign in to comment.