package
0.5.36
Repository: https://github.com/devlights/try-golang.git
Documentation: pkg.go.dev

# README

サンプルリスト

このディレクトリには以下のサンプルがあります。

fileexample namenote
nonstop.gogoroutines_nonstopゴルーチンを待ち合わせ無しで走らせるサンプルです
withdonechannel.gogoroutines_with_done_channeldoneチャネルを用いて待ち合わせを行うサンプルです
withwaitgroup.gogoroutines_with_waitgroupsync.WaitGroupを用いて待ち合わせを行うパターンです
withcontextcancel.gogoroutines_with_context_cancelcontext.Contextを用いて待ち合わせを行うサンプルです
withcontexttimeout.gogoroutines_with_context_timeoutcontext.Contextを用いてタイムアウト付きで待ち合わせを行うサンプルです
withcontextdeadline.gogoroutines_with_context_deadlinecontext.Context::WithDeadline を使ったサンプルです
selectnilchan1.gogoroutines_select_nil_chan_1select ステートメントで nil チャネル を使って選択されるチャネルの有効・無効を切り替えるサンプルです (1)
selectnilchan2.gogoroutines_select_nil_chan_2select ステートメントで nil チャネル を使って選択されるチャネルの有効・無効を切り替えるサンプルです (2)
usingchansemaphore.gogoroutines_using_chan_semaphoreチャネルでセマフォの動作を行わせるサンプルです
usingmutex.gogoroutines_using_mutexsync.Mutex を利用したサンプルです
workerpool.gogoroutines_workerpoolWorker Pool パターンのサンプルです
context_and_timeafterfunc.gogoroutines_context_and_timeafterfuncContextAndTimeAfterFunc は、Context と time.AfterFunc でキャンセルするサンプルです

# Packages

Package chansemaphore は、チャネルでセマフォの動作を実現するサンプルが配置されています.
Package leak -- ゴルーチンリークについてのサンプルが配置されているパッケージです。 */.

# Functions

ContextAndTimeAfterFunc は、Context と time.AfterFunc でキャンセルするサンプルです.
NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。.
NonStop -- ゴルーチンを待ち合わせ無しで走らせるサンプルです.
SelectNilChan1 -- select ステートメントで nil チャネル を使って選択されるチャネルの有効・無効を切り替えるサンプルです (1).
SelectNilChan2 -- select ステートメントで nil チャネル を使って選択されるチャネルの有効・無効を切り替えるサンプルです (2).
SelectNilChan3 -- select ステートメントで nil チャネル を使って選択されるチャネルの有効・無効を切り替えるサンプルです (3).
UsingChanSemaphore -- チャネルでセマフォの動作を行わせるサンプルです.
UsingMutex -- sync.Mutex を利用したサンプルです.
WithContextCancel -- context.Contextを用いて待ち合わせを行うサンプルです.
WithContextCancelCause は、Go 1.20 で新規追加された context.WithCancelCause のサンプルです.
WithContextDeadline -- context.WithDeadline を使ったサンプルです.
WithContextTimeout -- context.Contextを用いてタイムアウト付きで待ち合わせを行うサンプルです.
WithDoneChannel -- doneチャネルを用いて待ち合わせを行うサンプルです.
WithWaitGroup -- sync.WaitGroupを用いて待ち合わせを行うパターンです.
WorkerPool -- Worker Pool パターンのサンプルです.