From 2610e293d16e77d8b7e31189fe1c9abf864d9af4 Mon Sep 17 00:00:00 2001 From: ne-sachirou Date: Thu, 26 Dec 2024 01:52:02 +0900 Subject: [PATCH] =?UTF-8?q?=E8=B5=B7=E5=8B=95=E3=82=84=E7=B5=82=E4=BA=86?= =?UTF-8?q?=E3=81=AB=E5=A4=B1=E6=95=97=E3=81=97=E3=81=9F=E6=99=82=E3=82=92?= =?UTF-8?q?debug=E3=81=99=E3=82=8Bcode=E3=82=92=E6=AE=98=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=8A=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/example/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/example/main.go b/cmd/example/main.go index a91fa80..10bb3c8 100644 --- a/cmd/example/main.go +++ b/cmd/example/main.go @@ -32,6 +32,7 @@ func (s *ExampleServer) Serve() error { } }() fmt.Println("example serve") + //return errors.New("faild to serve the server") return nil } @@ -40,6 +41,8 @@ func (s *ExampleServer) Shutdown(ctx context.Context) error { select { case <-s.shutdowned: fmt.Println("example shutdown") + //time.Sleep(time.Second * 2) + //return errors.New("faild to shutdown the server") return nil case <-ctx.Done(): if err := ctx.Err(); errors.Is(err, context.DeadlineExceeded) { @@ -59,6 +62,7 @@ func (s *ExampleBlockingServer) Serve() error { s.done = make(chan struct{}) s.shutdowned = make(chan struct{}) fmt.Println("example blocking serve") + //return errors.New("faild to serve the blocking server") for { select { case <-s.done: @@ -76,6 +80,8 @@ func (s *ExampleBlockingServer) Shutdown(ctx context.Context) error { select { case <-s.shutdowned: fmt.Println("example blocking shutdown") + //time.Sleep(time.Second * 2) + //return errors.New("faild to shutdown the blocking server") return nil case <-ctx.Done(): if err := ctx.Err(); errors.Is(err, context.DeadlineExceeded) {