viper-app/pkg/channel/any.go

16 lines
203 B
Go
Raw Normal View History

package channel
type Any[T any] chan T
func NewAny[T any]() Any[T] {
return make(Any[T])
}
func NewBufferAny[T any](i int) Any[T] {
return make(Any[T], i)
}
func (ch Any[T]) Send(v T) {
ch <- v
}