Merge pull request #899 from ijc25/prepareStdio-named-return

prepareStdio: use named return for err
This commit is contained in:
Michael Crosby 2017-05-24 09:22:47 -07:00 committed by GitHub
commit ab137bfef8

View File

@ -21,8 +21,8 @@ import (
"google.golang.org/grpc/grpclog" "google.golang.org/grpc/grpclog"
) )
func prepareStdio(stdin, stdout, stderr string, console bool) (*sync.WaitGroup, error) { func prepareStdio(stdin, stdout, stderr string, console bool) (wg *sync.WaitGroup, err error) {
var wg sync.WaitGroup wg = &sync.WaitGroup{}
ctx := gocontext.Background() ctx := gocontext.Background()
f, err := fifo.OpenFifo(ctx, stdin, syscall.O_WRONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700) f, err := fifo.OpenFifo(ctx, stdin, syscall.O_WRONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700)
@ -73,7 +73,7 @@ func prepareStdio(stdin, stdout, stderr string, console bool) (*sync.WaitGroup,
}(f) }(f)
} }
return &wg, nil return wg, nil
} }
func getGRPCConnection(context *cli.Context) (*grpc.ClientConn, error) { func getGRPCConnection(context *cli.Context) (*grpc.ClientConn, error) {