Added localhost to net.Listen() calls to avoid macOS firewall dialog. (#1539)

This commit is contained in:
Hein Meling
2017-09-26 10:19:45 -07:00
committed by Menghan Li
parent d555c82380
commit c67cd636f9
8 changed files with 9 additions and 9 deletions

View File

@ -31,7 +31,7 @@ import (
)
const (
port = ":50051"
port = "50051"
)
// server is used to implement helloworld.GreeterServer.
@ -43,7 +43,7 @@ func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloRe
}
func main() {
lis, err := net.Listen("tcp", port)
lis, err := net.Listen("tcp", "localhost:"+port)
if err != nil {
log.Fatalf("failed to listen: %v", err)
}