func (g *micro) Generate(file *generator.FileDescriptor) {
	if len(file.FileDescriptorProto.Service) == 0 {
		return
	}
	g.P("// Reference imports to suppress errors if they are not otherwise used.")
	g.P("var _ ", apiPkg, ".Endpoint")
	g.P("var _ ", contextPkg, ".Context")
	g.P("var _ ", clientPkg, ".Option")
	g.P("var _ ", serverPkg, ".Option")
	g.P()
	for i, service := range file.FileDescriptorProto.Service {
		g.generateService(file, service, i)
	}
}
Generate generates code for the services in the given file.
package micro
import (
	"fmt"
	"path"
	"strconv"
	"strings"
	"github.com/golang/protobuf/proto"
	pb "github.com/golang/protobuf/protoc-gen-go/descriptor"
	"github.com/micro/micro/v3/cmd/protoc-gen-micro/generator"
	options "google.golang.org/genproto/googleapis/api/annotations"
)
const (
	apiPkgPath     = "github.com/micro/micro/v3/service/api"
	contextPkgPath = "context"
	clientPkgPath  = "github.com/micro/micro/v3/service/client"
	serverPkgPath  = "github.com/micro/micro/v3/service/server"
)
func init() {
	generator.RegisterPlugin(new(micro))
}
type micro struct {
	gen *generator.Generator
}
func (g *micro) Name() string {
	return "micro"
}
var (
	apiPkg     string
	contextPkg string
	clientPkg  string
	serverPkg  string
	pkgImports map[generator.GoPackageName]bool
)
func (g *micro) Init(gen *generator.Generator) {
	g.gen = gen
	apiPkg = generator.RegisterUniquePackageName("api", nil)
	contextPkg = generator.RegisterUniquePackageName("context", nil)
	clientPkg = generator.RegisterUniquePackageName("client", nil)
	serverPkg = generator.RegisterUniquePackageName("server", nil)
}
func (g *micro) objectNamed(name string) generator.Object {
	g.gen.RecordTypeUse(name)
	return g.gen.ObjectNamed(name)
}
func (g *micro) typeName(str string) string {
	return g.gen.TypeName(g.objectNamed(str))
}
func (g *micro) P(args ...interface{}) { g.gen.P(args...) }