code: func (s *Server) RegisterEndpoint(name string, handler interface{}) error {
  	s.logger.Printf("[WARN] consul: endpoint injected; this should only be used for testing")
  	return s.rpcServer.RegisterName(name, handler)
  }
docs: // RegisterEndpoint is used to substitute an endpoint for testing.