func (closer *Closer) IsClosed() bool {
	select {
	case <-closer.channel:
		return true
	default:
		return false
	}
}
IsClosed returns whether the channel is closed.
package util
import "context"
type Closer struct {
	channel chan struct{}  
}
func NewCloser() Closer {
	return Closer{make(chan struct{})}
}
func (closer *Closer) Close() {
	close(closer.channel)
}
func (closer *Closer) CloseChannel() chan struct{} {
	return closer.channel
}
func (closer *Closer) Context() context.Context {
	ctx, cancel := context.WithCancel(context.Background())
	go func() {
		select {
		case <-closer.channel:
			cancel()
		case <-ctx.Done():
		}
	}()
	return ctx
}