摘要:
package main import ( "context" "fmt" "time" ) func teeChannel(ctx context.Context, value <-chan int) (<-chan int, <-chan int) { ch1 := make(chan int) 阅读全文
posted @ 2024-07-10 13:13
saneim
阅读(18)
评论(0)
推荐(0)
摘要:
package main import ( "context" "fmt" ) // orDone func orDone(ctx context.Context, value <-chan int) <-chan int { ordoneStream := make(chan int) go fu 阅读全文
posted @ 2024-07-10 13:11
saneim
阅读(56)
评论(0)
推荐(0)
摘要:
扇入扇出寻找素数: package main import ( "fmt" "math/rand" "runtime" "sync" "time" ) var repeatFn = func(done <-chan interface{}, fn func() interface{}) <-chan 阅读全文
posted @ 2024-07-10 13:09
saneim
阅读(63)
评论(0)
推荐(0)
摘要:
package main import ( "fmt" "net/http" ) type Results struct { Error error Response *http.Response } func main() { checkStatus := func(done <-chan int 阅读全文
posted @ 2024-07-10 13:06
saneim
阅读(15)
评论(0)
推荐(0)
摘要:
package main import ( "fmt" "math/rand" ) func main() { pFn := func(done <-chan interface{}, fn func() int) <-chan int { valueStream := make(chan int) 阅读全文
posted @ 2024-07-10 13:04
saneim
阅读(8)
评论(0)
推荐(0)
摘要:
package main import ( "fmt" "time" ) func main() { var or func(channels ...<-chan interface{}) <-chan interface{} or = func(channels ...<-chan interfa 阅读全文
posted @ 2024-07-10 13:01
saneim
阅读(12)
评论(0)
推荐(0)
浙公网安备 33010602011771号