colly
colly copied to clipboard
Can not use colly/debug
When I try to use colly/debug this error is occured:
Cannot use '&debug.LogDebugger{}' (type *LogDebugger) as the type debug.Debugger Type
does not implement 'debug.Debugger' need the method: Event(e *Event) have the method: Event(e *Event)
My source code
package bootstrap
import (
"github.com/gocolly/colly/v2"
"github.com/gocolly/colly/debug"
)
// BuildColly /* *colly.Collector
func BuildColly() (*colly.Collector, error) {
coll := colly.NewCollector(
// Attach a debugger to the collector
colly.Debugger(&debug.LogDebugger{}),
colly.MaxDepth(1),
colly.Async(true),
)
return coll, nil
}
Screenshot

I think this is because you are not importing the v2
of debug
, so to speak:
import (
"github.com/gocolly/colly/v2"
"github.com/gocolly/colly/v2/debug"
)
I am not getting that error doing that