func main() {
	lis, err := net.Listen("tcp", fmt.Sprintf(":%d", 50051))
	if err != nil {
		log.Fatalf("failed to listen: %v", err)
	}
	s := api.Server{}
	conn1, err := grpc.Dial("0.0.0.0:50052", grpc.WithInsecure())
	if err != nil {
		log.Fatalf("did not connect: %v", err)
	}
	defer conn1.Close()
	s.BillingClient = billing.NewBillingClient(conn1)
	conn2, err := grpc.Dial("0.0.0.0:50053", grpc.WithInsecure())
	if err != nil {
		log.Fatalf("did not connect: %v", err)
	}
	defer conn2.Close()
	s.PaymentsClient = payments.NewPaymentsClient(conn2)
	grpcServer := grpc.NewServer()
	api.RegisterAccountsServer(grpcServer, &s)
	if err := grpcServer.Serve(lis); err != nil {
		log.Fatalf("failed to serve: %s", err)
	}
}
main start a gRPC server and waits for connection
package main
import (
	"fmt"
	"log"
	"net"
	api "github.com/weworksandbox/sg2019/api/accounts"
	"github.com/weworksandbox/sg2019/api/billing"
	"github.com/weworksandbox/sg2019/api/payments"
	"google.golang.org/grpc"
)