packagemainimport("log""github.com/nacos-group/nacos-sdk-go/clients""github.com/nacos-group/nacos-sdk-go/common/constant""github.com/nacos-group/nacos-sdk-go/vo""github.com/go-kratos/kratos/contrib/registry/nacos/v2""github.com/go-kratos/kratos/v2")funcmain(){sc:=[]constant.ServerConfig{*constant.NewServerConfig("127.0.0.1",8848),}client,err:=clients.NewNamingClient(vo.NacosClientParam{ServerConfigs:sc,},)iferr!=nil{log.Panic(err)}r:=nacos.New(client)// server
app:=kratos.New(kratos.Name("helloworld"),kratos.Registrar(r),)iferr:=app.Run();err!=nil{log.Fatal(err)}}