func ErrToChannel(fn func() error, ch chan<- error) {
	var err error
	for err = fn(); err == nil; err = fn() {
	}
	ch <- err
}
Call fn repeatedly until an error is returned; then send the error
on the given channel and return
package util
import (
	"bufio"
	"crypto/tls"
	"errors"
	"io"
	"net"
	"strings"
)