Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use micro.Server(gsvr.NewServer()),an error occurred #2591

Closed
suxing9980 opened this issue Nov 8, 2022 · 2 comments
Closed

use micro.Server(gsvr.NewServer()),an error occurred #2591

suxing9980 opened this issue Nov 8, 2022 · 2 comments

Comments

@suxing9980
Copy link

Describe the bug

errer :
../../pkg/mod/github.com/asim/go-micro/plugins/server/grpc/v3@v3.7.0/grpc.go:401:6: undefined: logger.Extract

code here:

package main

import (
	"hero/handler"
	pb "hero/proto"

	gsvr "github.com/asim/go-micro/plugins/server/grpc/v3"
	"github.com/asim/go-micro/v3"
	log "github.com/asim/go-micro/v3/logger"
)

var (
	service = "hero"
	version = "latest"
)

func main() {
	// Create service
	srv := micro.NewService(
		micro.Server(gsvr.NewServer()),
		micro.Name(service),
		micro.Version(version),
	)
	srv.Init()

	// Register handler
	pb.RegisterHeroHandler(srv.Server(), new(handler.Hero))

	// Run service
	if err := srv.Run(); err != nil {
		log.Fatal(err)
	}
}
@Davincible
Copy link
Contributor

You're using micro v3, which is not supported anymore. Please use micro v4.

@xpunch
Copy link
Contributor

xpunch commented Nov 19, 2022

Upgrade github.com/asim/go-micro/v3 to v3.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants