code: func (s *Server) RegisterService(desc *grpc.ServiceDesc, impl interface{}) {
  	serv := &service{
  		impl:    impl,
  		methods: make(map[string]grpc.MethodDesc, len(desc.Methods)),
  	}
  	for _, m := range desc.Methods {
  		serv.methods[m.MethodName] = m
  	}
  
  	s.mu.Lock()
  	defer s.mu.Unlock()
  
  	if s.services == nil {
  		s.services = map[string]*service{}
  	} else if _, ok := s.services[desc.ServiceName]; ok {
  		panic(fmt.Errorf("service %q is already registered", desc.ServiceName))
  	}
  
  	s.services[desc.ServiceName] = serv
  }
docs: // RegisterService registers a service implementation.
  // Called from the generated code.
  //
  // desc must contain description of the service, its message types
  // and all transitive dependencies.
  //
  // Panics if a service of the same name is already registered.