colly icon indicating copy to clipboard operation
colly copied to clipboard

Can not use colly/debug

Open netandreus opened this issue 3 years ago • 1 comments

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

Screenshot 2021-06-24 at 13 51 15

netandreus avatar Jun 24 '21 10:06 netandreus

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

rubenwap avatar Jul 02 '21 20:07 rubenwap