You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If Done is not yet closed, Err returns nil.
// If Done is closed, Err returns a non-nil error explaining why:
// Canceled if the context was canceled
// or DeadlineExceeded if the context's deadline passed.
// After Err returns a non-nil error, successive calls to Err return the same error.
現在の Server の定義は次のようになっています。
ここで、 問題なのはメソッド Serve の引数に context.Context があることです。これは不要というか無い方がいいのでは。
Server は「 Shutdown が呼ばれた時にシャットダウンする」のであって、引数の context がキャンセルされた時に停止するわけでは無いですよね。ここに context があると紛らわしいと思います。
単なる推測ですが、 (*http.Server).Serve や (*grpc.Server).Serve にも引数に context がないのもこれが理由なのではと思います。
The text was updated successfully, but these errors were encountered: