Undefined: host.IntrospectableHost

I’m following documentation at go-libp2p/examples/libp2p-host at master · libp2p/go-libp2p · GitHub.

While running the second example, I’m getting this error:

# github.com/libp2p/go-libp2p-core/host
../../go/pkg/mod/github.com/libp2p/go-libp2p-core@v0.20.1/host/host.go:23:32: undefined: host.IntrospectableHost

Please guide me through this.

same problem here.

How to resolve this?

it’s imports problem, and it’s already being resolved in examples

use
"github.com/libp2p/go-libp2p/core/host"

instead of
"github.com/libp2p/go-libp2p-core/host"