Added devp-deploy to rbd-exporter
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
@@ -9,7 +10,7 @@ import (
|
||||
|
||||
func mustCopy(dst io.Writer,src io.Reader) {
|
||||
if _,err := io.Copy(dst,src); err != nil {
|
||||
log.Fatalf("Error in mustCopy",err)
|
||||
log.Fatalf("Error in mustCopy %s",err)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +21,14 @@ func main() {
|
||||
log.Fatalf("Error in Dial %s",err)
|
||||
}
|
||||
defer conn.Close()
|
||||
done := make(chan struct{})
|
||||
|
||||
go mustCopy(os.Stdout,conn)
|
||||
mustCopy(conn,os.Stdin)
|
||||
go func() {
|
||||
io.Copy(os.Stdin,conn)
|
||||
fmt.Println("done")
|
||||
done <- struct{}{}
|
||||
}()
|
||||
io.Copy(conn,os.Stdout)
|
||||
conn.Close()
|
||||
<-done
|
||||
}
|
||||
Reference in New Issue
Block a user