goutils/pkg/other/other.go
Samuel Becker c50cf88dd0 Added function to send a single value into a channel.
Is a wrapper for goroutines and similar where a return value can't be collected
Also added Goland's file things
2023-01-19 12:51:46 +01:00

8 lines
281 B
Go

package other
// OutputIntoChannel takes a singular return value and sends it into the target channel.
// This is a wrapper for functions where a value can't be collected from directly.
// Example: goroutines
func OutputIntoChannel[T any](out T, target chan T) {
target <- out
}